docker-compose.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. version: "3"
  2. services:
  3. db:
  4. image: postgres:13.2-alpine
  5. volumes:
  6. - ./data/db:/var/lib/postgresql/data
  7. environment:
  8. - POSTGRES_DB=postgres
  9. - POSTGRES_USER=postgres
  10. - POSTGRES_PASSWORD=postgres
  11. ports:
  12. - 5432:5432
  13. cache:
  14. image: redis:6.2-alpine
  15. ports:
  16. - 6379:6379
  17. broker:
  18. image: rabbitmq:3.8-management-alpine
  19. volumes:
  20. - ./data/broker:/var/lib/rabbitmq
  21. environment:
  22. - RABBITMQ_DEFAULT_USER=rabbitmq
  23. - RABBITMQ_DEFAULT_PASS=rabbitmq
  24. ports:
  25. - 5672:5672
  26. - 15672:15672
  27. web:
  28. build:
  29. context: .
  30. dockerfile: Dockerfile
  31. volumes:
  32. - .:/app
  33. - ./media:/media
  34. ports:
  35. - "8000:8000"
  36. environment:
  37. - DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
  38. - REDIS_URL=redis://cache:6379/0
  39. - CELERY_BROKER_URL=amqp://rabbitmq:rabbitmq@broker:5672/
  40. env_file:
  41. - .env
  42. depends_on:
  43. - db
  44. - cache
  45. - broker
  46. nginx:
  47. image: nginx:alpine
  48. volumes:
  49. - ./data/static:/static # Путь к статическим файлам
  50. - ./nginx.conf:/etc/nginx/nginx.conf # Ваш файл конфигурации Nginx
  51. ports:
  52. - "80:80"
  53. depends_on:
  54. - web