- Dockerfile +14 -17
Dockerfile
CHANGED
@@ -1,26 +1,23 @@
|
|
1 |
-
# Use a multi-stage build to manage different services
|
2 |
-
|
3 |
# 1. Traefik stage
|
4 |
FROM traefik as traefik-stage
|
5 |
|
6 |
-
# Set Traefik command options
|
7 |
-
CMD ["traefik",
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
]
|
18 |
|
19 |
# Expose ports for Traefik
|
20 |
EXPOSE 80 443
|
21 |
|
22 |
# Mount volumes
|
23 |
-
VOLUME ["/
|
24 |
|
25 |
# 2. InitContainer stage for permission adjustment
|
26 |
FROM busybox as init-stage
|
@@ -49,10 +46,10 @@ VOLUME ["/var/run/docker.sock", "/root/data/.n8n:/home/node/.n8n"]
|
|
49 |
|
50 |
# Labels for Traefik routing
|
51 |
LABEL traefik.enable=true
|
52 |
-
LABEL traefik.http.routers.n8n.rule=Host(
|
53 |
LABEL traefik.http.routers.n8n.tls=true
|
54 |
LABEL traefik.http.routers.n8n.entrypoints=websecure
|
55 |
-
LABEL traefik.http.routers.n8n.rule=PathPrefix(
|
56 |
LABEL traefik.http.middlewares.n8n-stripprefix.stripprefix.prefixes=/app1
|
57 |
LABEL traefik.http.routers.n8n.middlewares=n8n-stripprefix
|
58 |
LABEL traefik.http.routers.n8n.tls.certresolver=mytlschallenge
|
|
|
|
|
|
|
1 |
# 1. Traefik stage
|
2 |
FROM traefik as traefik-stage
|
3 |
|
4 |
+
# Set Traefik command options in a single CMD instruction
|
5 |
+
CMD ["traefik",
|
6 |
+
"--api=true",
|
7 |
+
"--api.insecure=true",
|
8 |
+
"--api.dashboard=true",
|
9 |
+
"--providers.docker=true",
|
10 |
+
"--providers.docker.exposedbydefault=false",
|
11 |
+
"--entrypoints.websecure.address=:443",
|
12 |
+
"--certificatesresolvers.mytlschallenge.acme.tlschallenge=true",
|
13 |
+
"--certificatesresolvers.mytlschallenge.acme.email=shayanrl87@gmail.com",
|
14 |
+
"--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"]
|
|
|
15 |
|
16 |
# Expose ports for Traefik
|
17 |
EXPOSE 80 443
|
18 |
|
19 |
# Mount volumes
|
20 |
+
VOLUME ["/root/data/n8n/letsencrypt:/letsencrypt", "/var/run/docker.sock:/var/run/docker.sock:ro"]
|
21 |
|
22 |
# 2. InitContainer stage for permission adjustment
|
23 |
FROM busybox as init-stage
|
|
|
46 |
|
47 |
# Labels for Traefik routing
|
48 |
LABEL traefik.enable=true
|
49 |
+
LABEL traefik.http.routers.n8n.rule=Host('shayanrl-n8n.hf.space')
|
50 |
LABEL traefik.http.routers.n8n.tls=true
|
51 |
LABEL traefik.http.routers.n8n.entrypoints=websecure
|
52 |
+
LABEL traefik.http.routers.n8n.rule=PathPrefix('/app1{regex:$$|/.*}')
|
53 |
LABEL traefik.http.middlewares.n8n-stripprefix.stripprefix.prefixes=/app1
|
54 |
LABEL traefik.http.routers.n8n.middlewares=n8n-stripprefix
|
55 |
LABEL traefik.http.routers.n8n.tls.certresolver=mytlschallenge
|