-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathcompose.yml
More file actions
172 lines (143 loc) · 3.73 KB
/
compose.yml
File metadata and controls
172 lines (143 loc) · 3.73 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
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
# Reference docs: https://docs.docker.com/compose/compose-file/compose-file-v3/
services:
db:
container_name: db
image: postgres:17
init: true
volumes:
- postgres_data:/var/lib/postgresql/data/
ports:
- "5432:5432"
env_file:
- .env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
redis:
container_name: redis
image: redis:7.0
init: true
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
mailpit:
container_name: mailpit
image: axllent/mailpit
init: true
ports:
- "8025:8025"
- "1025:1025"
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8025/livez"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
web:
container_name: web
image: epicserve/django-base-site:python
init: true
build:
context: .
dockerfile: config/docker/Dockerfile.web
target: dev
command: >
sh -c "
./manage.py migrate --noinput &&
if [ \"$$USE_DEBUGPY\" = \"true\" ]; then
echo '=========================================' &&
echo 'Starting Django with debugger enabled' &&
echo 'Debugger listening on 0.0.0.0:5678' &&
echo 'Attach from VS Code, LazyVim, or any DAP client' &&
echo '=========================================' &&
python -m debugpy --listen 0.0.0.0:5678 ./manage.py runserver 0.0.0.0:8000 --nothreading --noreload
else
./manage.py runserver 0.0.0.0:8000
fi
"
volumes:
- .:/srv/app:cached
ports:
- "8000:8000"
- "5678:5678" # debugpy port for VS Code/LazyVim debugging
depends_on:
node:
condition: service_healthy
db:
condition: service_healthy
redis:
condition: service_healthy
mailpit:
condition: service_healthy
environment:
USE_DOCKER: 'on'
DJANGO_SETTINGS_MODULE: config.settings
# Pass through USE_DEBUGPY from shell or .env file (defaults to empty/false)
USE_DEBUGPY: ${USE_DEBUGPY:-}
worker:
container_name: worker
image: epicserve/django-base-site:python
init: true
command: sh -c "celery -A config worker -l info"
volumes:
- .:/srv/app:cached
depends_on:
web:
condition: service_started
mailpit:
condition: service_healthy
environment:
DJANGO_SETTINGS_MODULE: config.settings
node:
container_name: node
image: epicserve/django-base-site:node
build:
context: .
dockerfile: config/docker/Dockerfile.node
init: true
working_dir: /srv/app
command: sh -c "npm run dev"
volumes:
- .:/srv/app
- node_modules:/srv/app/node_modules
ports:
- "3000:3000"
environment:
NODE_ENV: development
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
docs:
container_name: docs
image: epicserve/django-base-site:python
init: true
command: sh -c "mkdocs serve -f config/mkdocs.yml --dev-addr 0.0.0.0:4000"
volumes:
- .:/srv/app:cached
ports:
- "4000:4000"
environment:
LIVE_RELOAD_SUPPORT: 'true'
FAST_MODE: 'true'
profiles:
- full
- docs
depends_on:
web:
condition: service_started
volumes:
postgres_data:
redis_data:
node_modules: