Prova a utilizzare network , non ne sono sicuro ma forse può aiutarti :
version: '3'
# ----------------
# CREATE NEW NETWORK
networks:
app:
driver: bridge
# ----------------
services:
due:
restart: always
build:
context: ./
dockerfile: ./docker/bot/Dockerfile
command: ./due
depends_on:
- due_database
# ---------------
# SPECIFY NETWORK
networks:
- app
# ---------------
due_database:
build:
context: ./
dockerfile: ./docker/database/Dockerfile
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD="docker"
entrypoint: /entry.sh
volumes:
- ./.dueutil_db:/dueutil_data
# ---------------
# SPECIFY NETWORK
networks:
- app
# ---------------