version: '3.8'

services:
  portfolio-website:
    restart: unless-stopped
    build:
      context: https://github.com/kinou-p/portfolio-website.git#main
      dockerfile: Dockerfile
    container_name: portfolio-website
    networks:
      - portfolio
    labels:
      - "traefik.enable=true"
      
      # Configuration HTTPS

      - "traefik.http.routers.portfolio-website.rule=Host(`alexandre-pommier.com`)"
      - "traefik.http.routers.portfolio-website.entrypoints=https"
      - "traefik.http.routers.portfolio-website.tls=true"
      - "traefik.http.services.portfolio-website.loadbalancer.server.port=80"

      - "traefik.http.routers.portfolio-website.middlewares=hstsHeader"

    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s

networks:
  portfolio:
    external: true

