services: psql: image: postgres:latest environment: POSTGRES_DB: ${DB_DATABASE} POSTGRES_USER: ${DB_USERNAME} POSTGRES_PASSWORD: ${DB_PASSWORD} ports: - "${DB_PORT}:5432" volumes: - psql_volume:/var/lib/postgresql/data networks: - identity_network app: build: . ports: - "8080:8080" environment: PORT: ${PORT} APP_ENV: ${APP_ENV} DB_HOST: psql DB_PORT: ${DB_PORT} DB_DATABASE: ${DB_DATABASE} DB_USERNAME: ${DB_USERNAME} DB_PASSWORD: ${DB_PASSWORD} DB_SCHEMA: ${DB_SCHEMA} networks: - identity_network depends_on: - psql volumes: psql_volume: networks: identity_network: driver: bridge