-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
240 lines (231 loc) · 6.45 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
240 lines (231 loc) · 6.45 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
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
name: remind_dev
services:
frontend:
build:
context: .
dockerfile: Dockerfile.dev
target: frontend-dev
command:
- sh
- -c
- npm ls --depth=0 >/dev/null 2>&1 || npm ci; exec npm run dev:frontend -- --host 0.0.0.0
ports:
- "5173:5173"
environment:
- VITE_BACKEND_URL=http://backend:5000
volumes:
- .:/app
- frontend_node_modules:/app/node_modules
depends_on:
backend:
condition: service_healthy
networks:
- dev
backend:
build:
context: .
dockerfile: Dockerfile.dev
target: backend-dev
command: flask --app app_factory:create_app run --host=0.0.0.0 --port=5000 --debug
ports:
- "5000:5000"
env_file:
- path: .env
required: true
- path: .env.dev
required: false
environment:
- ENVIRONMENT=development
- LOAD_DOTENV=false
- FLASK_SKIP_DOTENV=1
- FLASK_ENV=development
- FLASK_DEBUG=1
- SECRET_KEY=dev-secret-key-change-me
- AI_PROVIDER_API_KEY=${AI_PROVIDER_API_KEY:-}
- GEMINI_API_KEY=${GEMINI_API_KEY:-}
- AI_PROVIDER_MODEL_NAME=gemini-3.1-flash-lite
- BACKEND_URL=http://127.0.0.1:5000
- DATABASE_URL=postgresql://remind:remind-dev-password@db:5432/remind_db
- REDIS_URL=redis://:remind-dev-redis-password@redis:6379/0
- CELERY_BROKER_URL=redis://:remind-dev-redis-password@redis:6379/1
- CELERY_RESULT_BACKEND=redis://:remind-dev-redis-password@redis:6379/1
- LOCALHOST_MODE=True
- ALLOW_GUEST_CHATS_SAVE=True
- ENABLE_STRICT_HTTPS=False
- VALIDATE_USER_AGENT=False
- CORS_ORIGINS=http://127.0.0.1:5173,http://localhost:5173,${DEV_LAN_ORIGIN:-}
- ALLOWED_HOSTS=127.0.0.1,localhost,backend,${DEV_LAN_HOST:-}
- SESSION_COOKIE_DOMAIN=
- SESSION_COOKIE_NAME=remind_dev_session
- TURNSTILE_SITE_KEY=
- TURNSTILE_SECRET_KEY=
- LOGIN_RATE_LIMIT_MAX_REQUESTS=100
- LOGIN_RATE_LIMIT_WINDOW_SECONDS=60
- BRUTE_FORCE_MAX_LOGIN_ATTEMPTS=50
- BRUTE_FORCE_LOCKOUT_SECONDS=60
- BRUTE_FORCE_PROGRESSIVE_LOCKOUT=False
- BRUTE_FORCE_MAX_LOCKOUT_SECONDS=60
- PYTHON_RUNNER_ENABLED=True
- PYTHON_RUNNER_QUEUE=/var/lib/remind-python-runner
volumes:
- .:/app
- python_runner_dev_queue:/var/lib/remind-python-runner
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
init-python-runner-storage:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
interval: 10s
timeout: 5s
retries: 10
start_period: 15s
networks:
- dev
worker:
build:
context: .
dockerfile: Dockerfile.dev
target: backend-dev
command: python scripts/reload_on_change.py -- celery -A celery_worker.celery worker --loglevel=info --concurrency=2 --pool=solo
env_file:
- path: .env
required: true
- path: .env.dev
required: false
environment:
- ENVIRONMENT=development
- LOAD_DOTENV=false
- FLASK_SKIP_DOTENV=1
- FLASK_ENV=development
- FLASK_DEBUG=1
- SECRET_KEY=dev-secret-key-change-me
- AI_PROVIDER_API_KEY=${AI_PROVIDER_API_KEY:-}
- GEMINI_API_KEY=${GEMINI_API_KEY:-}
- AI_PROVIDER_MODEL_NAME=gemini-3.1-flash-lite
- DATABASE_URL=postgresql://remind:remind-dev-password@db:5432/remind_db
- REDIS_URL=redis://:remind-dev-redis-password@redis:6379/0
- CELERY_BROKER_URL=redis://:remind-dev-redis-password@redis:6379/1
- CELERY_RESULT_BACKEND=redis://:remind-dev-redis-password@redis:6379/1
- ENABLE_STRICT_HTTPS=False
- VALIDATE_USER_AGENT=False
- SESSION_COOKIE_DOMAIN=
- SESSION_COOKIE_NAME=remind_dev_session
- PYTHON_RUNNER_ENABLED=True
- PYTHON_RUNNER_QUEUE=/var/lib/remind-python-runner
volumes:
- .:/app
- python_runner_dev_queue:/var/lib/remind-python-runner
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
init-python-runner-storage:
condition: service_completed_successfully
networks:
- dev
init-python-runner-storage:
build:
context: .
dockerfile: Dockerfile.python-runner
user: "0:0"
command:
- sh
- -c
- chown 0:0 /jobs && chmod 700 /jobs && mkdir -p /jobs/requests /jobs/responses && chown -R 1001:0 /jobs && chmod 2770 /jobs /jobs/requests /jobs/responses
volumes:
- python_runner_dev_queue:/jobs
network_mode: none
restart: "no"
cap_drop:
- ALL
cap_add:
- CHOWN
- DAC_OVERRIDE
- FOWNER
security_opt:
- no-new-privileges:true
python-runner:
build:
context: .
dockerfile: Dockerfile.python-runner
environment:
- PYTHON_RUNNER_QUEUE=/jobs
volumes:
- python_runner_dev_queue:/jobs
depends_on:
init-python-runner-storage:
condition: service_completed_successfully
network_mode: none
read_only: true
tmpfs:
- /tmp:rw,noexec,nosuid,nodev,size=640m,mode=0711
- /dev/shm:rw,noexec,nosuid,nodev,size=1m,mode=000
user: "0:0"
cap_drop:
- ALL
cap_add:
- SETUID
- SETGID
- KILL
- CHOWN
- DAC_OVERRIDE
security_opt:
- no-new-privileges:true
pids_limit: 64
mem_limit: 768m
cpus: 0.75
ulimits:
nofile:
soft: 128
hard: 128
nproc:
soft: 64
hard: 64
restart: unless-stopped
db:
image: postgres:15-alpine
environment:
POSTGRES_USER: remind
POSTGRES_PASSWORD: remind-dev-password
POSTGRES_DB: remind_db
volumes:
- postgres_dev_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U remind -d remind_db"]
interval: 10s
timeout: 5s
retries: 5
networks:
- dev
redis:
image: redis:7-alpine
environment:
- REDISCLI_AUTH=remind-dev-redis-password
command:
- redis-server
- --appendonly
- "yes"
- --requirepass
- remind-dev-redis-password
volumes:
- redis_dev_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
networks:
- dev
volumes:
frontend_node_modules:
postgres_dev_data:
redis_dev_data:
python_runner_dev_queue:
networks:
dev: