docker-compose.prod.yml 602 B

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