Files
nginx/docker-compose.yml
2026-07-18 17:47:55 +02:00

31 lines
1.1 KiB
YAML

---
services:
nginx:
image: nginx:${NGINX_VERSION}
restart: unless-stopped
labels:
### Section Træfik
- traefik.enable=${TRAEFIK_ENABLED}
- traefik.docker.network=${TRAEFIK_NETWORK}
# HTTPS
- traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https
# configure the exposed service
- traefik.http.routers.https-${TRAEFIK_ROUTER}.middlewares=${TRAEFIK_MIDDLEWARES}
- traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=${TRAEFIK_MATCHRULE}
# enable TLS and its certificate provider
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=${TRAEFIK_TLSENABLED}
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls.certresolver=${TRAEFIK_CERTRESOLVER}
# specify a service so a custom port can be used
- traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=${TRAEFIK_SERVICE_PORT}
volumes:
- ${NGINX_CONFIG}:/etc/nginx/nginx.conf
- ${NGINX_SITECONFIG}:/etc/nginx/conf.d/default.conf
- ${NGINX_DATA}:/var/www/html
networks:
- traefik
networks:
traefik:
external: true
name: ${TRAEFIK_NETWORK}