-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yml
89 lines (81 loc) · 3.06 KB
/
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
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: gitops
services:
frontend:
image: maestrops/frontend:9-1d8bdd2
env_file:
- frontend/.env
depends_on:
- backend
ports:
- "5173:5173"
labels:
- "traefik.enable=true"
# HTTP Router
- "traefik.http.routers.frontend-http.rule=(Host(`test.drintech.online`) || Host(`www.test.drintech.online`))"
- "traefik.http.routers.frontend-http.entrypoints=web"
- "traefik.http.services.frontend.loadbalancer.server.port=5173"
# www to non-www redirect
- "traefik.http.routers.frontend-https.middlewares=www-to-non-www"
# HTTPS Router
- "traefik.http.routers.frontend-https.rule=(Host(`test.drintech.online`) || Host(`www.test.drintech.online`))"
- "traefik.http.routers.frontend-https.entrypoints=websecure"
- "traefik.http.routers.frontend-https.tls.certresolver=letsencryptresolver"
- "traefik.http.routers.frontend-https.service=frontend" # optional
networks:
- app-network
backend:
image: maestrops/backend:8-cbbea3f
env_file:
- backend/.env
networks:
- app-network
labels:
- traefik.enable=true
# HTTP Router
- traefik.http.routers.backend-http.rule=((Host(`test.drintech.online`) || Host(`www.test.drintech.online`)) && (PathPrefix(`/api`) || PathPrefix(`/redoc`) || PathPrefix(`/docs`)))
- traefik.http.routers.backend-http.entrypoints=web
- traefik.http.services.backend-http.loadbalancer.server.port=8000
# www to non-www redirect
- "traefik.http.routers.backend-https.middlewares=www-to-non-www"
# HTTPS Router
- traefik.http.routers.backend-https.rule=(Host(`test.drintech.online`) && (PathPrefix(`/api`) || PathPrefix(`/redoc`) || PathPrefix(`/docs`)))
- traefik.http.routers.backend-https.entrypoints=websecure
- traefik.http.routers.backend-https.tls.certresolver=letsencryptresolver
depends_on:
- db
db:
image: postgres:13
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
networks:
- app-network
expose:
- "5432"
volumes:
- postgres_data:/var/lib/postgresql/data
adminer:
image: adminer
restart: always
environment:
ADMINER_DEFAULT_SERVER: db
labels:
- traefik.enable=true
# HTTP Router
- traefik.http.routers.adminer-http.rule=Host(`db.test.drintech.online`) || Host(`www.db.test.drintech.online`)
- traefik.http.routers.adminer-http.entrypoints=web
- traefik.http.services.adminer.loadbalancer.server.port=8080
# www to non-www redirect
- "traefik.http.routers.adminer-https.middlewares=www-to-non-www"
# HTTPS Router
- traefik.http.routers.adminer-https.rule=Host(`db.test.drintech.online`) || Host(`www.db.test.drintech.online`)
- traefik.http.routers.adminer-https.entrypoints=websecure
- traefik.http.routers.adminer-https.tls.certresolver=letsencryptresolver
networks:
- app-network
networks:
app-network:
external: true
volumes:
postgres_data: