Advertisement
sevensky

composer demo

Jan 14th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. version: '3'
  2.  
  3. services:
  4.  
  5. celery:
  6. image: newswall
  7. container_name: celery_newswall
  8. working_dir: /app
  9. command: bash -c "celery -A newswallproj worker -l info"
  10. volumes:
  11. - ./src:/app
  12. env_file:
  13. - .env
  14. links:
  15. - db
  16. - redis
  17. depends_on:
  18. - redis
  19. - web
  20. restart: always
  21. logging:
  22. driver: "json-file"
  23. options:
  24. max-size: "20m"
  25. max-file: "20"
  26.  
  27.  
  28. celery_beat:
  29. image: newswall
  30. container_name: celerybeat_newswall
  31. working_dir: /app
  32. command: bash -c "celery -A newswallproj.celery beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler"
  33. volumes:
  34. - ./src:/app
  35. env_file:
  36. - .env
  37. links:
  38. - db
  39. - redis
  40. depends_on:
  41. - redis
  42. - web
  43. restart: always
  44. logging:
  45. driver: "json-file"
  46. options:
  47. max-size: "20m"
  48. max-file: "20"
  49.  
  50. celery_flower:
  51. image: newswall
  52. container_name: celeryflower_newswall
  53. working_dir: /app
  54. ports:
  55. ##################### Change on production ###################
  56. - "8081:8081"
  57. command: flower -A newswallproj --port=8081 --basic_auth="${CELERY_FLOWER_USER:?err}:${CELERY_FLOWER_PASSWORD:?err}"
  58. volumes:
  59. - ./src:/app
  60. depends_on:
  61. - redis
  62. - celery
  63. - celery_beat
  64. restart: always
  65. logging:
  66. driver: "json-file"
  67. options:
  68. max-size: "20m"
  69. max-file: "20"
  70.  
  71. db:
  72. image: postgres:9.6
  73. container_name: db_newswall
  74. hostname: db
  75. env_file:
  76. - .env
  77. build:
  78. context: config/db
  79. dockerfile: Dockerfile
  80. volumes:
  81. - db-data:/var/lib/postgresql/data
  82. restart: always
  83. logging:
  84. driver: "json-file"
  85. options:
  86. max-size: "20m"
  87. max-file: "20"
  88.  
  89.  
  90. redis:
  91. image: redis:latest
  92. container_name: redis_newswall
  93. hostname: redis
  94. restart: always
  95. logging:
  96. driver: "json-file"
  97. options:
  98. max-size: "20m"
  99. max-file: "20"
  100.  
  101. nginx:
  102. image: nginx:latest
  103. container_name: nginx_newswall
  104. ports:
  105. - "8080:80"
  106. volumes:
  107. - ./src:/app
  108. - ./config/nginx/nginx.conf:/etc/nginx/nginx.conf
  109. depends_on:
  110. - web
  111. restart: always
  112. logging:
  113. driver: "json-file"
  114. options:
  115. max-size: "20m"
  116. max-file: "20"
  117.  
  118. web:
  119. build:
  120. context: .
  121. dockerfile: Dockerfile
  122. image: newswall
  123. container_name: django_newswall
  124. hostname: web
  125. command: bash -c "rm -f celerybeat.pid && ls && python manage.py migrate news --database=default --noinput && python manage.py migrate tracking --database=tracking --noinput && python manage.py migrate --noinput && python manage.py initadmin && python manage.py collectstatic --noinput && gunicorn newswallproj.wsgi:application --workers 1 --bind unix:/app/newswallproj.sock"
  126. volumes:
  127. - ./src:/app
  128. env_file:
  129. - .env
  130. links:
  131. - db
  132. - redis
  133. depends_on:
  134. - db
  135. restart: always
  136. logging:
  137. driver: "json-file"
  138. options:
  139. max-size: "20m"
  140. max-file: "20"
  141.  
  142. volumes:
  143. db-data:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement