version: "3.9" services: rustapp: container_name: rustapp build: context: . dockerfile: Dockerfile args: DATABASE_URL: postgres://postgres:postgres@db:5432/postgres ports: - "8080:8080" environment: PORT: 8080 depends_on: - db db: container_name: db image: "postgres:12" ports: - "5432:5432" environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_DB=postgres volumes: - pgdata:/var/lib/postgresql/data volumes: pgdata: {}