-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
41 lines (39 loc) · 1.73 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
version: '3.7'
services:
traefik:
image: "traefik:v2.5"
container_name: "traefik"
command:
- "--api.insecure=true" # Disable authentication for the Traefik dashboard (for demo purposes)
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "[email protected]" # Replace with your actual email
- "--certificatesresolvers.myresolver.acme.storage=acme.json"
- "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.myresolver.acme.storage=/acme.json"
- "--api.dashboard=true" # Enable the Traefik dashboard
ports:
- "80:80"
- "443:443"
- "8080:8080" # Expose Traefik dashboard port
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./acme.json:/acme.json" # Ensure acme.json is persisted
static-site:
build:
context: .
dockerfile: Dockerfile
container_name: "static-site"
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.https-redirect.redirectscheme.permanent=true"
- "traefik.http.routers.static-site-http.rule=Host(`foobarspectrum.online`)"
- "traefik.http.routers.static-site-http.entrypoints=web"
- "traefik.http.routers.static-site-http.middlewares=https-redirect"
- "traefik.http.routers.static-site-https.rule=Host(`foobarspectrum.online`)"
- "traefik.http.routers.static-site-https.entrypoints=websecure"
- "traefik.http.routers.static-site-https.tls.certresolver=myresolver"
volumes:
- "./static_code:/usr/share/nginx/html"