version: '3.8'services: backend: build: context: . dockerfile: Dockerfile volumes: - .:/app - /app/node_modules env_file: - .env ports: - "8000:8000" depends_on: - mongodb version: '3.8'services: backend: build: context: . dockerfile: Dockerfile volumes: - .:/app - /app/node_modules env_file: - .env ports: - "8000:8000" depends_on: - mongodb mongodb: image: mongo:latest ports: - "27017:27017" volumes: - mongodb_data:/data/db command: ["mongod", "--quiet"]volumes: mongodb_data: mongodb: image: mongo:latest ports: - "27017:27017" volumes: - mongodb_data:/data/db command: ["mongod", "--quiet"]volumes: mongodb_data:
FROM node:18 AS baseWORKDIR /appCOPY package*.json ./RUN npm installFROM node:18-slimWORKDIR /appCOPY --from=base /app .EXPOSE 8000