networks:
  default:
  web:
    external: true

services:
  nginx:
    image: nginx:alpine
    volumes:
      - ./public:/usr/share/nginx/html:ro
      - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
    restart: unless-stopped
    labels:
      # Explicitly tell Traefik to expose this container
      - traefik.enable=true
      - traefik.docker.network=web
      # HTTPS
      - traefik.http.services.mg-hugo-service-secure.loadbalancer.server.port=80
      - traefik.http.routers.mg-hugo-secure.service=mg-hugo-service-secure
      - traefik.http.routers.mg-hugo-secure.entrypoints=websecure
      - traefik.http.routers.mg-hugo-secure.tls.certresolver=le
      - traefik.http.routers.mg-hugo-secure.rule=Host(`mistergeek.fr`, `www.mistergeek.fr`, `mistergeek.net`, `www.mistergeek.net`, `agence-webside.fr`, `www.agence-webside.fr`)
      - traefik.http.middlewares.mg-hugo-secure-cache.compress=true
      # HTTP
      - traefik.http.services.mg-hugo-service-insecure.loadbalancer.server.port=80
      - traefik.http.routers.mg-hugo-insecure.service=mg-hugo-service-insecure
      - traefik.http.routers.mg-hugo-insecure.entrypoints=web
      - traefik.http.routers.mg-hugo-insecure.rule=Host(`mistergeek.fr`, `www.mistergeek.fr`, `mistergeek.net`, `www.mistergeek.net`, `agence-webside.fr`, `www.agence-webside.fr`)
      - traefik.http.middlewares.mg-hugo-insecure-cache.compress=true
      - traefik.http.routers.traefik.tls=true
      - traefik.http.routers.traefik.tls.certresolver=le
      # GZIP
      - traefik.http.routers.traefik.middlewares=traefik-compress
      - traefik.http.middlewares.traefik-compress.compress=true
    networks:
      - web

  builder:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - .:/app
    networks:
      - default
    # command: ls -l
