-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.standalone.yml
More file actions
66 lines (58 loc) · 2.56 KB
/
Copy pathdocker-compose.standalone.yml
File metadata and controls
66 lines (58 loc) · 2.56 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
services:
# TYPESCRIPT
typescript:
container_name: "${PROJECT_NAME}_typescript"
build:
dockerfile: docker/Dockerfile
context: .
restart: always
ports:
- "3000:3000"
labels:
- "traefik.enable=true"
# Set domain and port for the reverse proxy
- "traefik.http.routers.${PROJECT_NAME}_typescript.rule=Host(`${PROJECT_BASE_URL}`)"
- "traefik.http.services.${PROJECT_NAME}_typescript.loadbalancer.server.port=3000"
# Redirect to HTTPS and use the TLS certificate resolver
- "traefik.http.routers.${PROJECT_NAME}_typescript.entrypoints=websecure"
- "traefik.http.routers.${PROJECT_NAME}_typescript.tls.certresolver=myresolver"
- "traefik.http.routers.${PROJECT_NAME}_typescript.middlewares=redirect-https"
# TRAEFIK (locale reverse proxy)
traefik:
image: traefik:v3.0
container_name: "${PROJECT_NAME}_traefik"
command:
- "--api.insecure=false"
- "--api.dashboard=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
# SSL Config
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
- "--certificatesresolvers.myresolver.acme.email=${LETSENCRYPT_EMAIL}"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
labels:
- "traefik.enable=true"
# Redirect HTTP to HTTPS
- "traefik.http.middlewares.redirect-https.redirectScheme.scheme=https"
- "traefik.http.middlewares.redirect-https.redirectScheme.permanent=true"
# Set domain and port for the reverse proxy (Dashboard)
- "traefik.http.routers.dashboard-plain.entrypoints=web"
- "traefik.http.routers.dashboard-plain.rule=Host(`traefik.${PROJECT_BASE_URL}`)"
- "traefik.http.routers.dashboard-plain.middlewares=redirect-https"
# Redirect to HTTPS and use the TLS certificate resolver
- "traefik.http.routers.dashboard.entrypoints=websecure"
- "traefik.http.routers.dashboard.tls.certresolver=myresolver"
- "traefik.http.routers.dashboard.rule=Host(`traefik.${PROJECT_BASE_URL}`)"
- "traefik.http.routers.dashboard.service=api@internal"
# Basic Auth
# - "traefik.http.routers.dashboard.middlewares=auth"
# - "traefik.http.middlewares.auth.basicauth.users=iven:$$apr1$$gktbi3ds$$z.Qi8HCECY4FWOxT3hz0Y0"
ports:
- '80:80'
- '443:443'
- '8080:8080' # Dashboard
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik/letsencrypt:/letsencrypt