Skip to content

Commit

Permalink
Remove unused certificates and update Traefik configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne committed Jan 31, 2024
1 parent 5a19586 commit 22e3007
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 98 deletions.
28 changes: 0 additions & 28 deletions cert.pem

This file was deleted.

4 changes: 0 additions & 4 deletions certificates.yml

This file was deleted.

34 changes: 20 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
version: "2"
services:
traefik:
image: traefik
restart: unless-stopped
container_name: traefik
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--providers.file.filename=/etc/traefik/certificates.yml"
image: traefik:v2.0.2
ports:
- "80:80"
- "443:443"
- "8080:8080"
labels:
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
volumes:
- ./traefik/traefik.yml:/etc/traefik/traefik.yml
- ./traefik/tls.yml:/etc/traefik/tls.yml
- /var/run/docker.sock:/var/run/docker.sock
- ./certificates.yml:/etc/traefik/certificates.yml
- ./key.pem:/certs/key.pem
- ./cert.pem:/certs/cert.pem
- certs:/etc/ssl/traefik
networks:
- web

Expand Down Expand Up @@ -57,13 +52,24 @@ services:
volumes:
- ./front:/app/src
labels:
- "traefik.enable=true"
- "traefik.http.routers.front.rule=HostRegexp(`{any:.*}`)"
- "traefik.http.routers.front.entrypoints=websecure"
- "traefik.http.routers.front.tls=true"
- "traefik.http.services.front.loadbalancer.server.port=3000"
networks:
- web

reverse-proxy-https-helper:
image: alpine
command: sh -c "cd /etc/ssl/traefik
&& wget traefik.me/cert.pem -O cert.pem
&& wget traefik.me/privkey.pem -O privkey.pem"
volumes:
- certs:/etc/ssl/traefik
networks:
- web

networks:
web:

volumes:
certs:
52 changes: 0 additions & 52 deletions key.pem

This file was deleted.

9 changes: 9 additions & 0 deletions traefik/tls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tls:
stores:
default:
defaultCertificate:
certFile: /etc/ssl/traefik/cert.pem
keyFile: /etc/ssl/traefik/privkey.pem
certificates:
- certFile: /etc/ssl/traefik/cert.pem
keyFile: /etc/ssl/traefik/privkey.pem
20 changes: 20 additions & 0 deletions traefik/traefik.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
logLevel: INFO

api:
insecure: true
dashboard: true

entryPoints:
http:
address: ":80"
https:
address: ":443"

providers:
file:
filename: /etc/traefik/tls.yml
docker:
endpoint: unix:///var/run/docker.sock
watch: true
exposedByDefault: true
defaultRule: 'HostRegexp(`{{ index .Labels "com.docker.compose.service"}}.traefik.me`,`{{ index .Labels "com.docker.compose.service"}}-{dashed-ip:.*}.traefik.me`)'

0 comments on commit 22e3007

Please sign in to comment.