Skip to content

Commit 46583f0

Browse files
committed
Review docker-compose.yaml
Signed-off-by: Federico Busetti <[email protected]>
1 parent f5709e9 commit 46583f0

File tree

1 file changed

+43
-36
lines changed

1 file changed

+43
-36
lines changed

docker-compose.yaml

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,4 @@
11
services:
2-
otel-collector:
3-
image: otel/opentelemetry-collector-contrib
4-
volumes:
5-
- ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
6-
7-
redis:
8-
image: redis
9-
10-
dramatiq-worker:
11-
build:
12-
dockerfile: Dockerfile
13-
context: .
14-
target: dramatiq_app
15-
env_file: local.env
16-
environment:
17-
OTEL_SERVICE_NAME: "bootstrap-fastapi-dramatiq-worker"
18-
working_dir: "/app/src"
19-
volumes:
20-
- '.:/app'
21-
depends_on:
22-
- redis
23-
- otel-collector
24-
command:
25-
- opentelemetry-instrument
26-
- dramatiq
27-
- --watch
28-
- .
29-
- -p
30-
- "1"
31-
- -t
32-
- "1"
33-
- dramatiq_worker
34-
352
dev:
363
build:
374
dockerfile: Dockerfile
@@ -46,7 +13,7 @@ services:
4613
volumes:
4714
- '.:/app'
4815
depends_on:
49-
- redis
16+
- dramatiq-worker
5017
- otel-collector
5118
command:
5219
- opentelemetry-instrument
@@ -60,13 +27,14 @@ services:
6027
# Remember to disable the reloader in order to allow otel instrumentation
6128
- --reload
6229

30+
# Production image
6331
http:
6432
build:
6533
dockerfile: Dockerfile
6634
context: .
6735
target: http_app
6836
depends_on:
69-
- redis
37+
- dramatiq-worker
7038
- otel-collector
7139
env_file: local.env
7240
environment:
@@ -76,7 +44,46 @@ services:
7644
volumes:
7745
- './src/sqlite.db:/app/sqlite.db'
7846

79-
# Starting from here there are only single-run commands, we can use `make` here
47+
#########################
48+
#### Helper services ####
49+
#########################
50+
51+
otel-collector:
52+
image: otel/opentelemetry-collector-contrib
53+
volumes:
54+
- ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
55+
56+
redis:
57+
image: redis
58+
59+
dramatiq-worker:
60+
build:
61+
dockerfile: Dockerfile
62+
context: .
63+
target: dramatiq_app
64+
env_file: local.env
65+
environment:
66+
OTEL_SERVICE_NAME: "bootstrap-fastapi-dramatiq-worker"
67+
working_dir: "/app/src"
68+
volumes:
69+
- '.:/app'
70+
depends_on:
71+
- redis
72+
- otel-collector
73+
command:
74+
- opentelemetry-instrument
75+
- dramatiq
76+
- --watch
77+
- .
78+
- -p
79+
- "1"
80+
- -t
81+
- "1"
82+
- dramatiq_worker
83+
84+
##########################
85+
#### One-off commands ####
86+
##########################
8087
test:
8188
build:
8289
dockerfile: Dockerfile

0 commit comments

Comments
 (0)