-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
131 lines (123 loc) · 3.13 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
131 lines (123 loc) · 3.13 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
services:
db:
image: postgres:17
container_name: cast-db-dev
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- db_data:/var/lib/postgresql/data
networks:
- cast-network
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
redis:
image: redis:7-alpine
container_name: cast-redis-dev
ports:
- "6379:6379" # Expose for local development
restart: unless-stopped
networks:
- cast-network
backend:
build:
context: ./backend
dockerfile: Dockerfile.arm # Change to Dockerfile.dev for non-ARM devices
container_name: cast-backend-dev
restart: unless-stopped
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
env_file:
- .env
volumes:
- ./data:/data # Use local data directory
- static:/app/staticfiles
networks:
- cast-network
command: >
sh -c "python manage.py migrate &&
python manage.py collectstatic --noinput &&
gunicorn config.wsgi:application --bind 0.0.0.0:8051 --workers 3 --reload"
daphne:
build:
context: ./backend
dockerfile: Dockerfile.arm
container_name: cast-daphne-dev
restart: unless-stopped
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
env_file:
- .env
volumes:
- ./data:/data
networks:
- cast-network
command: daphne -b 0.0.0.0 -p 8052 config.asgi:application
celery:
build:
context: ./backend
dockerfile: Dockerfile.arm # Change to Dockerfile.dev for non-ARM devices
container_name: cast-celery-dev
restart: unless-stopped
volumes:
- ./data:/data # Use local data directory
env_file:
- .env
networks:
- cast-network
depends_on:
- db
- redis
command: celery -A config worker --loglevel=info
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
args:
- REACT_APP_API_URL=http://localhost
container_name: cast-frontend-dev
restart: unless-stopped
environment:
- NODE_ENV=development
volumes:
- frontend_build:/shared-build # Share build with nginx
depends_on:
- backend
networks:
- cast-network
nginx:
image: nginx:alpine
container_name: cast-nginx-dev
ports:
- "80:80"
volumes:
- ./nginx/project.dev.conf:/etc/nginx/conf.d/default.conf
- frontend_build:/var/www/html
- static:/staticfiles:ro
- ./data/user_images:/data/user_images:ro
depends_on:
- backend
- daphne
- frontend
networks:
- cast-network
restart: unless-stopped
networks:
cast-network:
driver: bridge
volumes:
db_data:
static:
frontend_build: