version: "3.8"

services:
  queue:
    image: "queue-app:latest" 
    ports:
      - 5000
    volumes:
      - queue_data:/data
    environment:
      - DB_PATH=/data/queue.db
      - ADMIN_URL=secret-admin-panel
    restart: unless-stopped
    networks:
      - web       
    deploy:
      resources:
        limits:
          cpus: '2.0'
          memory: 512M    
      mode: replicated
      replicas: 1
      placement:
        constraints: [node.role == manager]
      labels:    
        - "traefik.enable=true"
        - "traefik.docker.network=web"         
        - "traefik.http.routers.queue.rule=Host(`domain.tld`)"  
        - "traefik.http.routers.queue.entrypoints=websecure"         
        - "traefik.http.services.queue.loadbalancer.server.port=5000"        
        - "traefik.http.routers.queue.tls=true"    
        - "traefik.http.routers.queue.tls.certresolver=myresolver"       

      
volumes:
  queue_data:

networks:  
  web:
    external:
      name: web   
