version: "3" services: traefik: image: traefik:v2.7 container_name: traefik command: - "--api.insecure=true" - "--providers.docker=true" - "--providers.docker.exposedbydefault=false" - "--entrypoints.web.address=:80" - "--entrypoints.websecure.address=:443" - "--certificatesresolvers.myresolver.acme.tlschallenge=true" - "--certificatesresolvers.myresolver.acme.email=${EMAIL}" - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json" ports: - "80:80" - "443:443" volumes: - "/var/run/docker.sock:/var/run/docker.sock:ro" - "./letsencrypt:/letsencrypt" restart: always env_file: - .env frontend: env_file: - ./frontend/.env build: context: frontend dockerfile: Dockerfile container_name: web restart: always labels: - "traefik.enable=true" - "traefik.http.routers.frontend.rule=Host(`${DOMAIN_NAME}`)" - "traefik.http.routers.frontend.entrypoints=websecure" - "traefik.http.routers.frontend.tls.certresolver=myresolver" depends_on: - traefik backend-core: env_file: - ./backend/.env build: context: backend dockerfile: Dockerfile container_name: backend-core restart: always volumes: - ./backend/:/code/ depends_on: - redis - worker - beat - traefik labels: - "traefik.enable=true" - "traefik.http.routers.backend-core.rule=Host(`${API_DOMAIN_NAME}`)" - "traefik.http.routers.backend-core.entrypoints=websecure" - "traefik.http.routers.backend-core.tls.certresolver=myresolver" - "traefik.http.services.backend-core.loadbalancer.server.port=5050" redis: image: redis:latest container_name: redis restart: always worker: env_file: - ./backend/.env build: context: backend dockerfile: Dockerfile container_name: worker command: celery -A celery_worker worker -l info restart: always depends_on: - redis beat: env_file: - ./backend/.env build: context: backend dockerfile: Dockerfile container_name: beat command: celery -A celery_worker beat -l info restart: always depends_on: - redis flower: env_file: - ./backend/.env build: context: backend dockerfile: Dockerfile container_name: flower command: celery -A celery_worker flower -l info --port=5555 restart: always depends_on: - redis - worker - beat labels: - "traefik.enable=true" - "traefik.http.routers.flower.rule=Host(`flower.${API_DOMAIN_NAME}`)" - "traefik.http.routers.flower.entrypoints=websecure" - "traefik.http.routers.flower.tls.certresolver=myresolver" - "traefik.http.services.flower.loadbalancer.server.port=5555"