[Unit]
Description=Valtrix Website
Requires=edge.network
After=edge.network

[Container]
Image=localhost/valtrixweb
ContainerName=valtrixwebsite
Network=edge
AutoUpdate=registry
Environment=TZ=Europe/Berlin

#Traefik Labels
Label=traefik.enable=true
Label=traefik.http.routers.wtw.rule=Host(`www.valtrix.systems`)
Label=traefik.http.services.wtw.loadbalancer.server.port=3000
Label=traefik.http.routers.wtw.entrypoints=websecure
Label=traefik.http.routers.wtw.tls=true
Label=traefik.http.routers.wtw.tls.certresolver=le

Label=traefik.http.routers.wtw-http.rule=Host(`www.valtrix.systems`)
Label=traefik.http.routers.wtw-http.entrypoints=web
Label=traefik.http.routers.wtw-http.middlewares=wtw-redirect
Label=traefik.http.middlewares.wtw-redirect.redirectscheme.scheme=https
Label=traefik.http.middlewares.wtw-redirect.redirectscheme.permanent=true
Label=traefik.http.routers.wtw.middlewares=secure-headers@file

Label="traefik.http.middlewares.wtw-sec.headers.customResponseHeaders.Content-Security-Policy=default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; script-src 'self'; script-src-elem 'self' 'unsafe-inline'; connect-src 'self' wss: https:; font-src 'self' data:; worker-src 'self' blob:;"
Label=traefik.http.routers.wtw.middlewares=wtw-sec@docker
Label=traefik.http.routers.wtw.middlewares=wtw-sec@docker
Label="traefik.http.routers.wtw.middlewares=auth"
Label="traefik.http.middlewares.auth.basicauth.users=smb:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"

[Service]
Restart=on-failure

[Install]
WantedBy=default.target