-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev.yml
213 lines (199 loc) · 5.56 KB
/
docker-compose.dev.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
version: "3.8"
services:
traefik:
image: traefik:latest
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
- "--api.dashboard=true"
- "--providers.docker.exposedByDefault=false"
- "--accesslog=true"
ports:
- "80:80"
- "8080:8080"
networks:
- backend
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: always
authentik-proxy:
image: ghcr.io/goauthentik/proxy
environment:
AUTHENTIK_HOST: $AUTHENTIK_HOST
AUTHENTIK_INSECURE: "true"
AUTHENTIK_TOKEN: $AUTHENTIK_TOKEN
AUTHENTIK_DEBUG: "true"
labels:
traefik.enable: true
traefik.port: 9000
traefik.http.routers.proxy.rule: Host(`$TRAEFIK_HOST`) && PathPrefix(`/outpost.goauthentik.io`)
traefik.http.middlewares.authentik.forwardauth.address: http://authentik-proxy:9000/outpost.goauthentik.io/auth/traefik
traefik.http.middlewares.authentik.forwardauth.trustForwardHeader: true
traefik.http.middlewares.authentik.forwardauth.authResponseHeaders: X-authentik-username,X-authentik-groups,X-authentik-email,X-authentik-name,X-authentik-uid,X-authentik-jwt,X-authentik-meta-jwks,X-aut>
restart: unless-stopped
networks:
- backend
postgres:
image: postgres:12.2
volumes:
- postgres_data:/data/postgres
environment:
POSTGRES_DB: $POSTGRES_DB
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
PGDATA: /data/postgres
ports:
- "5432:5432"
networks:
- backend
restart: always
bookings:
build:
context: ./back
dockerfile: Dockerfile.dev
develop:
watch:
- path: ./back
target: /home/bun/app
action: sync
- path: ./back/package.json
action: rebuild
networks:
- backend
depends_on:
- postgres
- authentik-proxy
environment:
SERVICE: bookings
DATABASE_URL: $DATABASE_URL
PORT: 3000
labels:
traefik.enable: true
traefik.http.routers.swagger.rule: Host(`$TRAEFIK_HOST`) && PathPrefix(`/docs`)
traefik.http.routers.swagger.middlewares: authentik
traefik.http.routers.swagger.service: bookings
traefik.http.routers.bookings.rule: Host(`$TRAEFIK_HOST`) && PathPrefix(`/api/bookings`)
traefik.http.routers.bookings.middlewares: authentik
traefik.http.routers.bookings.service: bookings
traefik.http.services.bookings.loadbalancer.server.port: 3000
search:
build:
context: ./back
dockerfile: Dockerfile.dev
develop:
watch:
- path: ./back
target: /home/bun/app
action: sync
- path: ./back/package.json
action: rebuild
networks:
- backend
depends_on:
- postgres
- authentik-proxy
environment:
SERVICE: search
DATABASE_URL: $DATABASE_URL
PORT: 3000
labels:
traefik.enable: true
traefik.http.routers.search.rule: Host(`$TRAEFIK_HOST`) && PathPrefix(`/api/search`)
traefik.http.routers.search.middlewares: authentik
traefik.http.services.search.loadbalancer.server.port: 3000
housings:
build:
context: ./back
dockerfile: Dockerfile.dev
develop:
watch:
- path: ./back
target: /home/bun/app
action: sync
- path: ./back/package.json
action: rebuild
networks:
- backend
environment:
SERVICE: housings
DATABASE_URL: $DATABASE_URL
PORT: 3000
depends_on:
- postgres
- authentik-proxy
labels:
traefik.enable: true
traefik.http.routers.housings.rule: Host(`$TRAEFIK_HOST`) && PathPrefix(`/api/housings`)
traefik.http.routers.housings.middlewares: authentik
traefik.http.services.housings.loadbalancer.server.port: 3000
users:
build:
context: ./back
dockerfile: Dockerfile.dev
develop:
watch:
- path: ./back
target: /home/bun/app
action: sync
- path: ./back/package.json
action: rebuild
networks:
- backend
environment:
SERVICE: users
DATABASE_URL: $DATABASE_URL
PORT: 3000
depends_on:
- postgres
- authentik-proxy
labels:
traefik.enable: true
traefik.http.routers.users.rule: Host(`$TRAEFIK_HOST`) && PathPrefix(`/api/users`)
traefik.http.routers.users.middlewares: authentik
traefik.http.services.users.loadbalancer.server.port: 3000
background:
build:
context: ./back
dockerfile: Dockerfile.dev
entrypoint: [ "bun", "run", "src/services/background/index.ts"]
environment:
SERVICE: background
DATABASE_URL: $DATABASE_URL
PORT: 3000
develop:
watch:
- path: ./back
target: /home/bun/app
action: sync
- path: ./back/package.json
action: rebuild
networks:
- backend
depends_on:
- postgres
front:
build:
context: ./front
dockerfile: Dockerfile.dev
develop:
watch:
- path: ./front
target: /home/bun/app
action: sync
- path: ./front/package.json
action: rebuild
networks:
- backend
ports:
- "24678:24678"
labels:
traefik.enable: true
traefik.http.routers.front.rule: Host(`$TRAEFIK_HOST`)
traefik.http.routers.front.entrypoints: web
traefik.http.services.front.loadbalancer.server.port: 3000
traefik.http.routers.front.middlewares: authentik
networks:
backend:
volumes:
postgres_data: