version: "3.3" services: pg: image: postgres:latest environment: POSTGRES_USER: '${POSTGRES_USER}' POSTGRES_DB: '${POSTGRES_DB}' POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}' ports: - '45432:5432' volumes: - "./db:/var/lib/postgresql/data" api: image: node:16 working_dir: /opt/mcrates/api depends_on: - 'pg' entrypoint: npm start environment: DATABASE_URL: 'postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@pg:5432/${POSTGRES_DB}?schema=public' volumes: - "./api:/opt/mcrates/api" client: image: node:16 working_dir: /opt/mcrates/client entrypoint: npm start ports: - '8080:8080' # fwd the hmr websocket volumes: - "./client:/opt/mcrates/client" - "./api:/opt/mcrates/api" nginx: image: nginx:latest depends_on: - 'api' volumes: - './nginx/localhost.nginx.conf:/etc/nginx/conf.d/default.conf' ports: - '80:80'