-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
130 lines (121 loc) · 2.71 KB
/
compose.yml
File metadata and controls
130 lines (121 loc) · 2.71 KB
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
name: "py-template"
services:
db:
image: postgres:17-alpine
platform: linux/amd64
ports:
- '52432:5432'
env_file:
- ./.env
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
- db-data:/var/lib/postgresql/data
api:
build:
context: .
dockerfile: docker/api/Dockerfile
command: python3 manage.py runserver 0.0.0.0:52000
volumes:
- ./app:/home/appuser/src
ports:
- "52000:52000"
scale: 1
env_file:
- ./.env
environment:
- DJANGO_SETTINGS_MODULE=core.settings
restart: always
depends_on:
- db
- redis
- redpanda
redis:
image: docker.dragonflydb.io/dragonflydb/dragonfly:latest
# You might pin to a specific version instead of “latest”
entrypoint: ["dragonfly", "--force_epoll"]
ulimits:
memlock: -1
ports:
- "52379:6379"
volumes:
- redis-data:/data
restart: unless-stopped
dashboard:
build:
context: .
dockerfile: docker/celery/Dockerfile-celery
command: celery --broker=${CELERY_BROKER_URL} flower --port=5555
ports:
- "52555:5555"
environment:
- DJANGO_SETTINGS_MODULE=core.settings
env_file:
- ./.env
depends_on:
- api
- redis
test:
build:
context: .
dockerfile: docker/test/Dockerfile-test
container_name: api-test-runner
command: pytest
volumes:
- ./app:/app
env_file:
- ./.env
environment:
DJANGO_SETTINGS_MODULE: core.settings_test
restart: no
depends_on:
- db
- redis
redpanda:
image: docker.redpanda.com/redpandadata/redpanda:latest
command:
- redpanda
- start
- --overprovisioned
- --smp=1
- --memory=1G
- --reserve-memory=0M
- --node-id=0
- --check=false
- --kafka-addr=PLAINTEXT://0.0.0.0:9092
- --advertise-kafka-addr=PLAINTEXT://redpanda:9092
ports:
- "9092:9092"
- "9644:9644"
healthcheck:
test: [ "CMD-SHELL", "rpk cluster info --brokers=redpanda:9092 || exit 1" ]
interval: 10s
timeout: 5s
retries: 10
redpanda-console:
image: docker.redpanda.com/redpandadata/console:latest
depends_on:
- redpanda
environment:
KAFKA_BROKERS: redpanda:9092
ports:
- "8080:8080"
email_worker:
build:
context: .
dockerfile: docker/api/Dockerfile
command: >
python3 manage.py consume_email_events
env_file:
- .env
environment:
DJANGO_SETTINGS_MODULE: core.settings
KAFKA_BOOTSTRAP_SERVERS: redpanda:9092
depends_on:
- redpanda
volumes:
db-data:
redis-data: