Merge pull request #752 from ChristianLempa/751-add-nginx-traefik-labels-improve-compose

751 add nginx traefik labels improve compose
This commit is contained in:
Christian Lempa 2025-02-19 09:03:11 +01:00 committed by GitHub
commit 28b2112240
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 2 deletions

View File

@ -5,9 +5,22 @@ services:
container_name: nginx
ports:
- 80:80
# (optional) uncomment the line below to enable HTTPS
# - 443:443
- 443:443
volumes:
- ./config/default.conf:/etc/nginx/conf.d/default.conf:ro
- ./data:/usr/share/nginx/html:ro
labels:
- traefik.enable=true
- traefik.http.services.nginx.loadbalancer.server.port=80
- traefik.http.routers.nginx.entrypoints=websecure
- traefik.http.routers.nginx.rule=Host(`example.com`)
- traefik.http.routers.nginx.tls=true
- traefik.http.routers.nginx.tls.certresolver=cloudflare
- traefik.http.routers.nginx.service=nginx
networks:
- frontend
restart: unless-stopped
networks:
frontend:
external: true

View File

@ -4,5 +4,6 @@ server {
location / {
root /usr/share/nginx/html;
index index.html;
access_log on;
}
}