version: "3.9"

services:
  shelfy:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: shelfy-go
    working_dir: /app
    ports:
      - "8090:8080"
      - "2121:2121"              # si tu gardes FTP
      - "30000-30100:30000-30100" # si tu gardes FTP
      - "2222:2222"              # SFTP

    extra_hosts:
      - "dockerhost:host-gateway" # accès à l'hôte depuis le conteneur
    volumes:
      - shelfy_upload:/app/upload
    labels:
      - traefik.http.routers.shelfy.middlewares=webdav-allow-methods@docker
      - traefik.http.middlewares.webdav-allow-methods.headers.accesscontrolallowmethods=GET,PUT,POST,DELETE,PROPFIND,OPTIONS,LOCK,UNLOCK,HEAD
      - traefik.http.middlewares.webdav-allow-methods.headers.accesscontrolallowheaders=Authorization,Depth,Content-Type,If-Modified-Since,User-Agent,Destination,Overwrite
    dns:
      - 8.8.8.8
      - 1.1.1.1
    restart: unless-stopped

volumes:
  shelfy_upload:
