Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. version: '3.7'
  2.  
  3. volumes:
  4. app-volume:
  5. postgres_data: {}
  6. x-app: &app
  7. build:
  8. context: .
  9. dockerfile: Dockerfile
  10. image: app
  11. volumes:
  12. - .:/collector
  13. depends_on:
  14. - postgres
  15. - redis
  16.  
  17.  
  18. services:
  19.  
  20. postgres:
  21. image: postgres:latest
  22. restart: unless-stopped
  23. volumes:
  24. - postgres_data:/var/lib/postgresql/data
  25. environment:
  26. POSTGRES_DB: collector_db
  27. POSTGRES_USER: collector
  28. POSTGRES_PASSWORD: 1234
  29. ports:
  30. - 5432:5432
  31. nginx:
  32. build: ./nginx
  33. ports:
  34. - 8000:8000
  35. volumes:
  36. - app-volume:/collector/static/
  37. depends_on:
  38. - app
  39.  
  40. app:
  41. <<: *app
  42. command: gunicorn --bind 0.0.0.0:8000 -w 1 -n collector collector.wsgi
  43. volumes:
  44. - app-volume:/collector/static/
  45. expose:
  46. - 8000
  47. depends_on:
  48. - postgres
  49. - redis
  50.  
  51. migration:
  52. <<: *app
  53. command: python manage.py migrate
  54. depends_on:
  55. - app
  56.  
  57. celery_worker:
  58. <<: *app
  59. command: celery -A collector worker -l error --concurrency=20 -n worker1@%h
  60. depends_on:
  61. - app
  62. celery_worker_2:
  63. <<: *app
  64. command: celery -A collector worker -l error --concurrency=20 -n worker2@%h
  65. depends_on:
  66. - app
  67.  
  68. celery_beat:
  69. <<: *app
  70. command: celery -A collector beat -l info
  71. depends_on:
  72. - app
  73. flower:
  74. <<: *app
  75. command: celery flower -A collector --address=0.0.0.0 --port=5555
  76. ports:
  77. - 5555:5555
  78. depends_on:
  79. - app
  80.  
  81. redis:
  82. image: redis:5.0.3-alpine
  83. restart: unless-stopped
  84. ports:
  85. - 6379:6379
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement