version: "3.4"

services:
  isso:
    build:
      context: .
      dockerfile: Dockerfile
    image: ${DOCKER_REGISTRY}/isso
    environment:
      - GID=1000
      - UID=1000
    volumes:
      - db:/db
    networks:
      - traefik-public
    healthcheck:
      test: wget --no-verbose --tries=1 --spider http://localhost:8080/info || exit 1
      interval: 5s
      retries: 3
      start_period: 5s
      timeout: 3s
    deploy:
      placement:
        constraints:
          - node.labels.isso == true
      labels:
        - traefik.enable=true
        - traefik.docker.network=traefik-public
        - traefik.constraint-label=traefik-public
        - traefik.http.routers.isso-http.rule=Host(`isso.knulst.de`)
        - traefik.http.routers.isso-http.entrypoints=http
        - traefik.http.routers.isso-http.middlewares=https-redirect
        - traefik.http.routers.isso-https.rule=Host(`isso.knulst.de`)
        - traefik.http.routers.isso-https.entrypoints=https
        - traefik.http.routers.isso-https.tls=true
        - traefik.http.routers.isso-https.tls.certresolver=le
        - traefik.http.services.isso.loadbalancer.server.port=8080
volumes:
  db:


networks:
  traefik-public:
    external: true
