services: db: image: postgres:15-alpine restart: unless-stopped env_file: .env environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} volumes: - db_data:/var/lib/postgresql/data ports: - "5440:5432" api: build: . # restart: unless-stopped env_file: .env volumes: - .:/app - /app/server/node_modules - /app/node_modules working_dir: /app depends_on: - db ports: - "4000:4000" - "8080:8080" command: > sh -c " npm install && cd server && npm install && cd .. && npm run dev " volumes: db_data: