1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-09-19 18:31:16 +00:00

Add Traefik and Nginx config files

This commit is contained in:
Mo 2022-08-18 03:40:30 +02:00
parent f15653b4cd
commit 7d35991671
4 changed files with 68 additions and 4 deletions

View file

@ -159,13 +159,13 @@ def create_traefik_container():
print("Creating container traefik.")
create_container(
"traefik",
f"""--label "io.containers.autoupdate=registry" \
--network {args.network} \
f"""--network {args.network} \
-p 80:80 \
-p 443:443 \
-v {TRAEFIK_ETC_DIR}:/etc/traefik:ro:Z,ro \
-v {TRAEFIK_LOGS_DIR}:/volumes/logs:Z \
-v {TRAEFIK_CERTS_DIR}:/volumes/certs:Z \
--label "io.containers.autoupdate=registry" \
docker.io/library/traefik:latest""",
)
@ -174,9 +174,9 @@ def create_nginx_container():
print("Creating container nginx.")
create_container(
"nginx",
f"""--label "io.containers.autoupdate=registry" \
--network {args.network} \
f"""--network {args.network} \
-v {NGINX_CONF_D_DIR}:/etc/nginx/conf.d:Z,ro \
--label "io.containers.autoupdate=registry" \
docker.io/library/nginx:alpine""",
)

View file

@ -0,0 +1,13 @@
server {
listen 80;
# Uncomment following line and replace SERVER_NAME!
# server_name SERVER_NAME;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://advlabdb;
}
}

View file

@ -0,0 +1,15 @@
---
http:
routers:
to_advlabdb:
# Uncomment following line and replace SERVER_NAME!
# rule: Host(`SERVER_NAME`)
service: advlabdb
tls:
certResolver: le
services:
advlabdb:
loadBalancer:
servers:
- url: http://nginx

View file

@ -0,0 +1,36 @@
---
global:
checkNewVersion: false
sendAnonymousUsage: true
log:
filePath: /volumes/logs/traefik.log
level: ERROR
entryPoints:
web:
address: :80
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: :443
certificatesResolvers:
le:
acme:
# Uncomment following line and replace EMAIL!
# email: EMAIL
storage: /volumes/certs/acme.json
tlsChallenge: {}
accessLog:
filePath: /volumes/logs/access.log
bufferingSize: 100
providers:
file:
filename: /etc/traefik/dynamic.yml