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.

123 lines
3.3 KiB

  1. version: "3.7"
  2. services:
  3. backend:
  4. build:
  5. context: ..
  6. dockerfile: docker/Dockerfile.prod
  7. image: doccano_backend:prod
  8. volumes:
  9. - static_volume:/backend/staticfiles
  10. - media:/backend/media
  11. - tmp_file:/backend/filepond-temp-uploads
  12. environment:
  13. ADMIN_USERNAME: "${ADMIN_USERNAME}"
  14. ADMIN_PASSWORD: "${ADMIN_PASSWORD}"
  15. ADMIN_EMAIL: ${ADMIN_EMAIL}
  16. CELERY_BROKER_URL: "amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbitmq"
  17. DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable"
  18. ALLOW_SIGNUP: "False"
  19. DEBUG: "False"
  20. DJANGO_SETTINGS_MODULE: "config.settings.production"
  21. depends_on:
  22. - postgres
  23. networks:
  24. - network-backend
  25. - network-frontend
  26. celery:
  27. build:
  28. context: ..
  29. dockerfile: docker/Dockerfile.prod
  30. image: doccano_celery:prod
  31. volumes:
  32. - media:/backend/media
  33. - tmp_file:/backend/filepond-temp-uploads
  34. entrypoint: ["/opt/bin/prod-celery.sh"]
  35. environment:
  36. PYTHONUNBUFFERED: "1"
  37. CELERY_BROKER_URL: "amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbitmq"
  38. DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable"
  39. DJANGO_SETTINGS_MODULE: "config.settings.production"
  40. depends_on:
  41. - postgres
  42. - rabbitmq
  43. networks:
  44. - network-backend
  45. flower:
  46. build:
  47. context: ..
  48. dockerfile: docker/Dockerfile.prod
  49. image: doccano_flower:prod
  50. entrypoint: ["/opt/bin/prod-flower.sh"]
  51. environment:
  52. PYTHONUNBUFFERED: "1"
  53. CELERY_BROKER_URL: "amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbitmq"
  54. DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable"
  55. DJANGO_SETTINGS_MODULE: "config.settings.production"
  56. FLOWER_BASIC_AUTH: "${FLOWER_BASIC_AUTH}" # Format "username:password"
  57. depends_on:
  58. - celery
  59. ports:
  60. - 5555:5555
  61. networks:
  62. - network-backend
  63. - network-frontend
  64. rabbitmq:
  65. image: rabbitmq:3.10.7-alpine
  66. environment:
  67. RABBITMQ_DEFAULT_USER: "${RABBITMQ_DEFAULT_USER}"
  68. RABBITMQ_DEFAULT_PASS: "${RABBITMQ_DEFAULT_PASS}"
  69. ports:
  70. - 5672:5672
  71. networks:
  72. - network-backend
  73. nginx:
  74. build:
  75. context: ..
  76. dockerfile: docker/Dockerfile.nginx
  77. image: doccano_nginx:prod
  78. command: >
  79. /bin/sh -c
  80. "envsubst '
  81. $${WORKER_PROCESSES}
  82. '< /etc/nginx/nginx.conf.template
  83. > /etc/nginx/nginx.conf
  84. && nginx -g 'daemon off;'"
  85. environment:
  86. API_URL: "http://backend:8000"
  87. GOOGLE_TRACKING_ID: ""
  88. WORKER_PROCESSES: "auto"
  89. volumes:
  90. - static_volume:/static
  91. - media:/media
  92. ports:
  93. - 80:8080
  94. depends_on:
  95. - backend
  96. networks:
  97. - network-frontend
  98. postgres:
  99. image: postgres:13.3-alpine
  100. volumes:
  101. - postgres_data:/var/lib/postgresql/data/
  102. environment:
  103. POSTGRES_USER: "${POSTGRES_USER}"
  104. POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
  105. POSTGRES_DB: "${POSTGRES_DB}"
  106. networks:
  107. - network-backend
  108. volumes:
  109. postgres_data:
  110. static_volume:
  111. media:
  112. tmp_file:
  113. networks:
  114. network-backend:
  115. network-frontend: