version: '3.8' services: backend: build: . ports: - "3000:3000" depends_on: - db environment: - NODE_ENV=development env_file: - .env volumes: - .:/app - /app/node_modules frontend: build: context: ./client dockerfile: Dockerfile ports: - "3001:3000" volumes: - ./client:/app - /app/node_modules environment: - REACT_APP_API_URL=http://localhost:3000 db: image: postgres:13-alpine ports: - "5432:5432" environment: - POSTGRES_USER=${DB_USER} - POSTGRES_PASSWORD=${DB_PASSWORD} - POSTGRES_DB=${DB_NAME} volumes: - ./db/init.sql:/docker-entrypoint-initdb.d/init.sql - postgres_data:/var/lib/postgresql/data volumes: postgres_data: