docker-compose.prod.yml 533 B

123456789101112131415161718192021222324252627282930313233
  1. version: '3'
  2. services:
  3. nextjs:
  4. build:
  5. context: .
  6. dockerfile: Dockerfile.prod
  7. ports:
  8. - "3000:3000"
  9. environment:
  10. - NODE_ENV=production
  11. - MONGODB_URI=mongodb://mongodb:27017/mydatabase
  12. depends_on:
  13. - mongodb
  14. mongodb:
  15. image: mongo
  16. volumes:
  17. - mongodb_data:/data/db
  18. nginx:
  19. image: nginx:alpine
  20. ports:
  21. - "80:80"
  22. volumes:
  23. - ./nginx:/etc/nginx/conf.d
  24. - ./logs/nginx:/var/log/nginx
  25. depends_on:
  26. - nextjs
  27. volumes:
  28. mongodb_data: