mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2025-02-22 05:20:49 +01:00
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:
commit
28b2112240
@ -5,9 +5,22 @@ services:
|
|||||||
container_name: nginx
|
container_name: nginx
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
# (optional) uncomment the line below to enable HTTPS
|
- 443:443
|
||||||
# - 443:443
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./config/default.conf:/etc/nginx/conf.d/default.conf:ro
|
- ./config/default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
- ./data:/usr/share/nginx/html: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
|
restart: unless-stopped
|
||||||
|
|
||||||
|
networks:
|
||||||
|
frontend:
|
||||||
|
external: true
|
||||||
|
@ -4,5 +4,6 @@ server {
|
|||||||
location / {
|
location / {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
access_log on;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user