You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.1 KiB

  1. version: "3.7"
  2. services:
  3. backend:
  4. build:
  5. context: .
  6. dockerfile: backend/Dockerfile.prod
  7. volumes:
  8. - static_volume:/backend/staticfiles
  9. - media:/backend/media
  10. environment:
  11. ADMIN_USERNAME: "${ADMIN_USERNAME}"
  12. ADMIN_PASSWORD: "${ADMIN_PASSWORD}"
  13. ADMIN_EMAIL: ${ADMIN_EMAIL}
  14. CELERY_BROKER_URL: "amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbitmq"
  15. DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable"
  16. ALLOW_SIGNUP: "False"
  17. DEBUG: "False"
  18. depends_on:
  19. - postgres
  20. networks:
  21. - network-backend
  22. - network-frontend
  23. celery:
  24. build:
  25. context: .
  26. dockerfile: backend/Dockerfile.prod
  27. volumes:
  28. - media:/backend/media
  29. entrypoint: ["/opt/bin/prod-celery.sh"]
  30. environment:
  31. PYTHONUNBUFFERED: "1"
  32. CELERY_BROKER_URL: "amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbitmq"
  33. DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable"
  34. depends_on:
  35. - postgres
  36. - rabbitmq
  37. networks:
  38. - network-backend
  39. rabbitmq:
  40. image: rabbitmq:3.8-alpine
  41. environment:
  42. RABBITMQ_DEFAULT_USER: "${RABBITMQ_DEFAULT_USER}"
  43. RABBITMQ_DEFAULT_PASS: "${RABBITMQ_DEFAULT_PASS}"
  44. ports:
  45. - 5672:5672
  46. networks:
  47. - network-backend
  48. nginx:
  49. build:
  50. context: .
  51. dockerfile: nginx/Dockerfile
  52. environment:
  53. API_URL: "http://backend:8000"
  54. GOOGLE_TRACKING_ID: ""
  55. volumes:
  56. - static_volume:/static
  57. - media:/media
  58. ports:
  59. - 80:8080
  60. depends_on:
  61. - backend
  62. networks:
  63. - network-frontend
  64. postgres:
  65. image: postgres:13.3-alpine
  66. volumes:
  67. - postgres_data:/var/lib/postgresql/data/
  68. environment:
  69. POSTGRES_USER: "${POSTGRES_USER}"
  70. POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
  71. POSTGRES_DB: "${POSTGRES_DB}"
  72. networks:
  73. - network-backend
  74. volumes:
  75. postgres_data:
  76. static_volume:
  77. media:
  78. networks:
  79. network-backend:
  80. network-frontend: