-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
57 lines (53 loc) · 1.37 KB
/
docker-compose.dev.yml
File metadata and controls
57 lines (53 loc) · 1.37 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
# Docker Compose for Development
# Provides local MongoDB and Redis for development
# Django and frontend run on host for faster development
services:
# MongoDB for local development
mongodb:
image: mongo:7.0
container_name: dsms-mongodb
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
environment:
MONGO_INITDB_DATABASE: dsms
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
# Redis for Celery and Django Channels
redis:
image: redis:7-alpine
container_name: dsms-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# Celery Worker (optional - for background tasks)
celery:
build:
context: .
dockerfile: docker/Dockerfile.worker
container_name: dsms-celery
depends_on:
- redis
- mongodb
environment:
- MONGODB_URI=mongodb://mongodb:27017/dsms
- REDIS_URL=redis://redis:6379
- DJANGO_SETTINGS_MODULE=dsms.conf.settings.development
volumes:
- ./src/dsms:/app
command: celery -A dsms.tasks worker -l info
profiles:
- with-worker # Only start with: docker compose --profile with-worker up
volumes:
mongodb_data:
redis_data: