docker-apps/www-sthome/stacks/compose.yml
2025-04-03 22:57:52 +02:00

41 lines
2.0 KiB
YAML

name: www-sthome
networks:
traefik-net:
external: true
services:
nginx:
image: nginx:latest
env_file: .nginx.env
# command: [nginx-debug, '-g', 'daemon off;']
networks:
traefik-net:
aliases: ["${SUBDOMAIN1}"]
volumes:
- ${DATADIR}/appdata:/var/sites
- ${DATADIR}/config/sites-enabled:/etc/nginx/sites-enabled
- ${DATADIR}/config/templates:/etc/nginx/templates
- ${DATADIR}/config/nginx.conf:/etc/nginx/nginx.conf:ro
- ${DATADIR}/logs:/var/log/nginx
- ${MEDIADIR}/uploads:/uploads
restart: unless-stopped
labels:
- traefik.enable=true
- traefik.docker.network=traefik-net
#- "traefik.http.middlewares.${APPLICATION_NAME}-auth.basicauth.usersfile=/mnt/users/${APPLICATION_NAME}.txt"
- "traefik.http.services.${APPLICATION_NAME}-svc.loadbalancer.server.port=${SERVICE_PORT}"
- "traefik.http.routers.${APPLICATION_NAME}-rtr.entrypoints=web"
- "traefik.http.routers.${APPLICATION_NAME}-rtr.rule=Host(`${SUBDOMAIN1}.${DOMAINNAME}`)&& PathPrefix(`/`)"
- "traefik.http.routers.${APPLICATION_NAME}-rtr.middlewares=http-mw-rateLimit-secureHeaders-compress-redirect@file"
- "traefik.http.routers.${APPLICATION_NAME}-rtr.service=${APPLICATION_NAME}-svc"
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.entrypoints=websecure"
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.rule=Host(`${SUBDOMAIN1}.${DOMAINNAME}`)&& PathPrefix(`/`)"
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.tls=true"
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.tls.options=tls-options@file"
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.tls.certresolver=solver-dns"
#- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.middlewares=${APPLICATION_NAME}-auth"
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.middlewares=http-mw-rateLimit-secureHeaders-compress@file"
- "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.service=${APPLICATION_NAME}-svc"