services:
  db:
    restart: unless-stopped
    image: postgres:17
    hostname: postgres
    volumes: 
     - db:/var/lib/postgresql/data
    env_file:
      - .env
    environment:
     POSTGRES_USER: semaphore
     POSTGRES_DB: semaphore
  semaphore:
    restart: unless-stopped
    ports:
      - 8085:3000
    image: semaphoreui/semaphore:v2.10.43
    env_file:
      - .env
    environment:
      SEMAPHORE_DB_USER: semaphore
      SEMAPHORE_DB_HOST: postgres
      SEMAPHORE_DB_PORT: 5432
      SEMAPHORE_DB_DIALECT: postgres
      SEMAPHORE_DB: semaphore
      SEMAPHORE_PLAYBOOK_PATH: /tmp/semaphore/
      TZ: UTC
    depends_on:
      - db
    labels:
      - "traefik.enable=true"
      - "traefik.http.services.semaphore-service.loadbalancer.server.port=8085"
      - "traefik.http.routers.semaphore.rule=Host(`semaphore.net.enpls.org`)"
      - "traefik.http.routers.semaphore.tls=true"
      - "traefik.http.routers.semaphore.tls.certresolver=defaultacme"
      - "traefik.http.routers.semaphore.entrypoints=websecure"
      - "traefik.http.routers.semaphore.service=semaphore-service"
      - "traefik.http.routers.semaphore.middlewares=proxyHeader@file,proxyError@file"
volumes:
  db:
    driver: local