4 Commits

Author SHA1 Message Date
1d87798722 removed diun, removed https redirect
handled by traefik
2026-07-18 17:47:55 +02:00
99ae0665a6 added clarification in README 2024-04-20 06:23:03 +02:00
2646f4fa2f added data directory 2024-04-20 06:21:35 +02:00
0158f56beb turned base to nginx deployment 2022-09-25 17:06:06 +02:00
3 changed files with 16 additions and 24 deletions

View File

@@ -1,2 +1,2 @@
# Base App Deployment # Nginx Deployment
This is the base on which (almost) every deployment is sort-of-based on. Data directory inside container: /var/www/html

View File

@@ -1,32 +1,26 @@
--- ---
services: services:
app: nginx:
image: nginx:${NGINX_VERSION}
restart: unless-stopped restart: unless-stopped
labels: labels:
### Section Træfik ### Section Træfik
- traefik.enable=${TRAEFIK_ENABLED} - traefik.enable=${TRAEFIK_ENABLED}
- traefik.docker.network=${TRAEFIK_NETWORK} - traefik.docker.network=${TRAEFIK_NETWORK}
## HTTP # HTTPS
- traefik.http.routers.http-${TRAEFIK_ROUTER}.entrypoints=http
# redirect to HTTPS only
- traefik.http.routers.http-${TRAEFIK_ROUTER}.middlewares=${TRAEFIK_HTTP_MIDDLEWARES}
- traefik.http.routers.http-${TRAEFIK_ROUTER}.rule=${TRAEFIK_MATCHRULE}
## HTTPS
- traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https - traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https
# configure the exposed service # configure the exposed service
- traefik.http.routers.https-${TRAEFIK_ROUTER}.middlewares=${TRAEFIK_HTTPS_MIDDLEWARES} - traefik.http.routers.https-${TRAEFIK_ROUTER}.middlewares=${TRAEFIK_MIDDLEWARES}
- traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=${TRAEFIK_MATCHRULE} - traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=${TRAEFIK_MATCHRULE}
# enable TLS and its certificate provider # enable TLS and its certificate provider
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=${TRAEFIK_TLSENABLED} - traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=${TRAEFIK_TLSENABLED}
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls.certresolver=${TRAEFIK_CERTRESOLVER} - traefik.http.routers.https-${TRAEFIK_ROUTER}.tls.certresolver=${TRAEFIK_CERTRESOLVER}
# specify a service so a custom port can be used # specify a service so a custom port can be used
- traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=${TRAEFIK_SERVICE_PORT} - traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=${TRAEFIK_SERVICE_PORT}
### Section Diun volumes:
- diun.enable=${DIUN_ENABLE} - ${NGINX_CONFIG}:/etc/nginx/nginx.conf
- diun.watch_repo=${DIUN_WATCHREPO} - ${NGINX_SITECONFIG}:/etc/nginx/conf.d/default.conf
- diun.sort_tags=${DIUN_SORTALGO} - ${NGINX_DATA}:/var/www/html
- diun.include_tags=${DIUN_INCLUDE}
- diun.exclude_tags=${DIUN_EXCLUDE}
networks: networks:
- traefik - traefik

View File

@@ -7,12 +7,10 @@ TRAEFIK_SERVICE_PORT=80
TRAEFIK_MATCHRULE=Host(`app.example.com`) TRAEFIK_MATCHRULE=Host(`app.example.com`)
TRAEFIK_TLSENABLED=true TRAEFIK_TLSENABLED=true
TRAEFIK_CERTRESOLVER=letsencrypt TRAEFIK_CERTRESOLVER=letsencrypt
TRAEFIK_HTTP_MIDDLEWARES=http-to-https TRAEFIK_MIDDLEWARES=hsts
TRAEFIK_HTTPS_MIDDLEWARES=hsts
# Diun # Nginx
DIUN_ENABLE=true NGINX_VERSION=alpine
DIUN_WATCHREPO=true NGINX_DATA=./data/httpdocs
DIUN_SORTALGO=semver NGINX_CONFIG=./data/nginx.conf
DIUN_INCLUDE= NGINX_SITECONFIG=./data/site.conf
DIUN_EXCLUDE=