docker-compose.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. version: "3.7"
  2. services:
  3. zitap:
  4. container_name: zitap-django
  5. build: .
  6. restart: on-failure
  7. environment:
  8. DJANGO_SECRET_KEY: <SECRET-KEY>
  9. DJANGO_DEBUG: "False"
  10. DJANGO_ALLOWED_HOSTS: <IP>,zitap.example.com,localhost
  11. DJANGO_CSRF_TRUSTED_ORIGINS: https://zitap.example.com
  12. DATABASE_ENGINE: django.db.backends.mysql
  13. DATABASE_NAME: <DATABASE-NAME>
  14. DATABASE_USERNAME: <USERNAME>
  15. DATABASE_PASSWORD: <PASSWORD>
  16. DATABASE_HOST: <IP-ADDRESS>
  17. DATABASE_PORT: 3306
  18. DATABASE_OPTIONS: "{\"init_command\": \"SET sql_mode='STRICT_TRANS_TABLES'\"}"
  19. volumes:
  20. - ./project:/app/project
  21. - ./zitap:/app/zitap
  22. - ./static:/static
  23. networks:
  24. - mysql
  25. - proxy
  26. labels:
  27. - 'traefik.enable=true'
  28. - 'traefik.http.routers.zitap.rule=Host(`zitap.example.com`)'
  29. - 'traefik.http.routers.zitap.tls=true'
  30. - 'traefik.http.routers.zitap.service=zitap'
  31. - 'traefik.http.services.zitap.loadbalancer.server.port=8000'
  32. - 'traefik.http.routers.zitap-static.rule=Host(`zitap.example.com`) && PathPrefix(`/static/`)'
  33. - 'traefik.http.routers.zitap-static.entrypoints=https'
  34. - 'traefik.http.routers.zitap-static.tls=true'
  35. - 'traefik.http.routers.zitap-static.service=zitap-static'
  36. - 'traefik.http.services.zitap-static.loadbalancer.server.port=80'
  37. networks:
  38. mysql:
  39. external: True
  40. proxy:
  41. external: True