I have a setup like
backend: build: backend ports: - "80:80" environment: PGSTRING: postgres://postgres:examplePW@db:543