-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
100 lines (91 loc) · 3.96 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
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
90
91
92
93
94
95
96
97
98
99
100
version: "3"
services:
traefik:
image: traefik:v2.10
ports:
- 80:80
labels:
- traefik.enable=true
- traefik.constraint-label=public
# GENERIC MIDDLEWARES
# - traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
# - traefik.http.middlewares.https-redirect.redirectscheme.permanent=true
- traefik.http.middlewares.gzip.compress=true
- traefik.http.middlewares.gzip.compress.excludedcontenttypes=image/png, image/jpeg, font/woff2
# GENERIC ROUTERS
# - traefik.http.routers.generic-https-redirect.entrypoints=http
# - traefik.http.routers.generic-https-redirect.rule=HostRegexp(`{host:.*}`)
# - traefik.http.routers.generic-https-redirect.priority=1
# - traefik.http.routers.generic-https-redirect.middlewares=https-redirect
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
command:
- --providers.docker
- --providers.docker.constraints=Label(`traefik.constraint-label`, `public`)
- --providers.docker.exposedbydefault=false
- --entrypoints.http.address=:80
# - --entrypoints.https.address=:443
- --accesslog
- --accesslog.format=json
- --accesslog.fields.headers.names.X-Varnish-Routed=keep
- --accesslog.fields.headers.names.RequestHost=keep
- --log
- --log.level=DEBUG
- --api
frontend:
image: ghcr.io/thalessalvador/intranet-interagi-frontend:latest
platform: linux/amd64
environment:
RAZZLE_INTERNAL_API_PATH: http://backend:8080/Plone
labels:
- traefik.enable=true
- traefik.constraint-label=public
# Service
- traefik.http.services.svc-frontend.loadbalancer.server.port=3000
# Router: Internal
- traefik.http.routers.rt-frontend-public.rule=Host(`intranet.localhost`)
- traefik.http.routers.rt-frontend-public.entrypoints=http
- traefik.http.routers.rt-frontend-public.service=svc-frontend
- traefik.http.routers.rt-frontend-public.middlewares=gzip
depends_on:
- backend
backend:
image: ghcr.io/thalessalvador/intranet-interagi-backend:latest
platform: linux/amd64
environment:
RELSTORAGE_DSN: "dbname='plone' user='plone' host='db' password='plone'"
labels:
- traefik.enable=true
- traefik.constraint-label=public
# Service
- traefik.http.services.svc-backend.loadbalancer.server.port=8080
# Middleware
## Virtual Host Monster for /++api++/
- "traefik.http.middlewares.mw-backend-vhm-api.replacepathregex.regex=^/\\+\\+api\\+\\+($$|/.*)"
- "traefik.http.middlewares.mw-backend-vhm-api.replacepathregex.replacement=/VirtualHostBase/http/intranet.localhost/Plone/++api++/VirtualHostRoot$$1"
## Virtual Host Monster for /ClassicUI/
- "traefik.http.middlewares.mw-backend-vhm-ui.replacepathregex.regex=^/ClassicUI($$|/.*)"
- "traefik.http.middlewares.mw-backend-vhm-ui.replacepathregex.replacement=/VirtualHostBase/http/intranet.localhost/Plone/VirtualHostRoot/_vh_ClassicUI$$1"
# Router
## /++api++/
- traefik.http.routers.rt-backend-api-public.rule=Host(`intranet.localhost`) && PathPrefix(`/++api++`)
- traefik.http.routers.rt-backend-api-public.entrypoints=http
- traefik.http.routers.rt-backend-api-public.service=svc-backend
- traefik.http.routers.rt-backend-api-public.middlewares=gzip,mw-backend-vhm-api
## /ClassicUI/
- traefik.http.routers.rt-backend-ui-internal.rule=Host(`intranet.localhost`) && PathPrefix(`/ClassicUI`)
- traefik.http.routers.rt-backend-ui-internal.entrypoints=http
- traefik.http.routers.rt-backend-ui-internal.service=svc-backend
- traefik.http.routers.rt-backend-ui-internal.middlewares=gzip,mw-backend-vhm-ui
depends_on:
- db
db:
image: postgres
environment:
POSTGRES_USER: plone
POSTGRES_PASSWORD: plone
POSTGRES_DB: plone
volumes:
- intranet-interagi-data:/var/lib/postgresql/data
volumes:
intranet-interagi-data: {}