-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yaml
171 lines (158 loc) · 3.93 KB
/
docker-compose.yaml
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
services:
dev:
build:
dockerfile: Dockerfile
context: .
target: dev
env_file: local.env
environment:
OTEL_SERVICE_NAME: "bootstrap-fastapi-dev"
ports:
- '8000:8000'
working_dir: "/app/src"
volumes:
- '.:/app'
depends_on:
- otel-collector
command:
- opentelemetry-instrument
- uvicorn
- http_app:create_app
- --host
- 0.0.0.0
- --port
- "8000"
- --factory
# Remember to disable the reloader in order to allow otel instrumentation
- --reload
# Production image
http:
build:
dockerfile: Dockerfile
context: .
target: http_app
depends_on:
- otel-collector
env_file: local.env
environment:
OTEL_SERVICE_NAME: "bootstrap-fastapi-http"
ports:
- '8001:8000'
volumes:
- './src/sqlite.db:/app/sqlite.db'
#########################
#### Helper services ####
#########################
otel-collector:
image: otel/opentelemetry-collector-contrib
volumes:
- ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
redis:
image: redis
dramatiq-worker:
build:
dockerfile: Dockerfile
context: .
target: dramatiq_app
env_file: local.env
environment:
OTEL_SERVICE_NAME: "bootstrap-fastapi-dramatiq-worker"
working_dir: "/app/src"
volumes:
- '.:/app'
depends_on:
- redis
- otel-collector
command:
- opentelemetry-instrument
- dramatiq
- --watch
- .
- -p
- "1"
- -t
- "1"
- dramatiq_worker
#################################
#### Authentication services ####
#################################
kratos-migrate:
image: oryd/kratos:v1.3.1
environment:
DSN: "sqlite:///etc/config/kratos/db.sqlite?_fk=true&mode=rwc"
volumes:
- ./auth_volumes/kratos:/etc/config/kratos
command: -c /etc/config/kratos/kratos.yml migrate sql -e --yes
restart: on-failure
kratos:
depends_on:
- kratos-migrate
image: oryd/kratos:v1.3.1
# It's not needed to expose these, leaving for documentation
# ports:
# - '4433:4433' # public API
# - '4434:4434' # admin API
restart: unless-stopped
environment:
DSN: "sqlite:///etc/config/kratos/db.sqlite?_fk=true&mode=rwc"
LOG_LEVEL: "trace"
volumes:
- ./auth_volumes/kratos:/etc/config/kratos
command: serve -c /etc/config/kratos/kratos.yml --dev --watch-courier
auth-ui:
image: oryd/kratos-selfservice-ui-node:v1.3.1
environment:
PORT: 3000
# Internal access URL for the BFF instance
KRATOS_PUBLIC_URL: "http://kratos:4433/"
# External access URL for the browser
KRATOS_BROWSER_URL: "http://127.0.0.1:8080/.ory/kratos/public"
JWKS_URL: "http://oathkeeper:4456/.well-known/jwks.json"
SECURITY_MODE: "jwks"
COOKIE_SECRET: "changeme"
CSRF_COOKIE_NAME: "ory_csrf_ui"
CSRF_COOKIE_SECRET: "changeme"
restart: on-failure
# mailslurper:
# image: oryd/mailslurper:latest-smtps
# ports:
# - '4436:4436'
# - '4437:4437'
oathkeeper:
image: oryd/oathkeeper:v0.40.8
depends_on:
- kratos
- auth-ui
- dev
ports:
# Public traffic port
- "8080:4455"
# Private traffic port, this is not usually exposed
# among other things it provides the JWKS url
# - "4456:4456"
command:
serve proxy -c "/etc/config/oathkeeper/oathkeeper.yml"
restart: on-failure
volumes:
- ./auth_volumes/oathkeeper:/etc/config/oathkeeper
##########################
#### One-off commands ####
##########################
test:
build:
dockerfile: Dockerfile
context: .
target: dev
volumes:
- '.:/app'
command:
- "make"
- "test"
ci-test:
build:
dockerfile: Dockerfile
context: .
target: dev
command:
- "make"
- "ci-test"