services:
    web:
        image: git.mifi.dev/mifi-holdings/mifi-links:latest
        container_name: mifi-links
        pull_policy: always
        restart: unless-stopped
        healthcheck:
            test: ['CMD', 'wget', '--quiet', '--tries=1', '--spider', 'http://127.0.0.1/']
            interval: 30s
            timeout: 3s
            start_period: 5s
            retries: 3
        labels:
            - 'traefik.enable=true'
            - 'traefik.docker.network=marina-net'
            # Dev (mifi.dev)
            - 'traefik.http.routers.mifi-dev.rule=Host(`mifi.dev`) || Host(`www.mifi.dev`)'
            - 'traefik.http.routers.mifi-dev.entrypoints=websecure'
            - 'traefik.http.routers.mifi-dev.service=mifi-dev'
            - 'traefik.http.routers.mifi-dev.middlewares=gzip@file,security-supermax-with-analytics@file,redirect-www-to-non-www@file'
            - 'traefik.http.routers.mifi-dev.tls=true'
            - 'traefik.http.routers.mifi-dev.tls.certresolver=letsencrypt'
            - 'traefik.http.services.mifi-dev.loadbalancer.server.port=80'
            # Bio (mifi.bio)
            - 'traefik.http.routers.mifi-bio.rule=Host(`mifi.bio`) || Host(`www.mifi.bio`)'
            - 'traefik.http.routers.mifi-bio.entrypoints=websecure'
            - 'traefik.http.routers.mifi-bio.service=mifi-bio'
            - 'traefik.http.routers.mifi-bio.middlewares=gzip@file,security-supermax-with-analytics@file,redirect-www-to-non-www@file'
            - 'traefik.http.routers.mifi-bio.tls=true'
            - 'traefik.http.routers.mifi-bio.tls.certresolver=letsencrypt'
            - 'traefik.http.services.mifi-bio.loadbalancer.server.port=80'
        networks:
            - marina-net

networks:
    marina-net:
        external: true
