Advertisement
Guest User

Untitled

a guest
Apr 11th, 2025
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. name: <project_name>
  2.  
  3. services:
  4. web:
  5. build: .
  6. container_name: <project_name>_app
  7. image: <project_name>_django
  8. command: /app/entrypoint.sh
  9. ports:
  10. - 8000:8000
  11. volumes:
  12. - .:/app # just so that local code is synced with our container
  13. depends_on:
  14. db:
  15. condition: service_healthy
  16. restart: true
  17. redis:
  18. condition: service_started
  19. env_file:
  20. - .env
  21.  
  22. db:
  23. image: postgres
  24. container_name: postgres
  25. restart: unless-stopped
  26. volumes:
  27. - postgresdb_data:/var/lib/postgresql/data
  28. healthcheck:
  29. test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
  30. interval: 10s
  31. retries: 5
  32. start_period: 30s
  33. timeout: 10s
  34. env_file:
  35. - .env
  36.  
  37. redis:
  38. image: redis:alpine
  39. container_name: redis
  40. volumes:
  41. - redis_data:/data
  42.  
  43. celery:
  44. build: .
  45. container_name: celery
  46. restart: unless-stopped
  47. volumes:
  48. - .:/app
  49. depends_on:
  50. - db
  51. - redis
  52. - web
  53. command: celery -A <project_name> worker -E -l info
  54. env_file:
  55. - .env
  56.  
  57. flower:
  58. build: .
  59. container_name: flower
  60. restart: unless-stopped
  61. command: 'celery -A <project_name> flower --basic_auth=admin:admin'
  62. ports:
  63. - 5555:5555
  64. volumes:
  65. - .:/app
  66. depends_on:
  67. - db
  68. - redis
  69. - web
  70. - celery
  71. env_file:
  72. - .env
  73.  
  74. volumes:
  75. postgresdb_data:
  76. redis_data:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement