-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
166 lines (160 loc) · 4.65 KB
/
docker-compose.dev.yml
File metadata and controls
166 lines (160 loc) · 4.65 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
services:
# Redis Service for Celery (Development)
dev-redis:
image: redis:7-alpine
ports:
- "${DEV_REDIS_PORT:-6380}:6379" # Use port 6380 for development to avoid conflicts
restart: unless-stopped
volumes:
- dev_redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
networks:
- dev-network
# MySQL Database Service (Development)
dev-mysql-db:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}_dev
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
volumes:
- dev_mysql_data:/var/lib/mysql
- ./mysql-init:/docker-entrypoint-initdb.d
ports:
- "0.0.0.0:${DEV_MYSQL_PORT:-3308}:3306" # Use port 3308 for development to avoid conflicts
restart: unless-stopped
command: --default-authentication-plugin=mysql_native_password
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "${DB_USER}", "-p${DB_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- dev-network
# Django Application Service (Development)
dev-django-app:
build:
context: .
dockerfile: Dockerfile.dev
ports:
- "${DEV_DJANGO_PORT:-8001}:8000" # Use port 8001 for development to avoid conflicts
- "${DEV_DEBUGPY_PORT:-5678}:5678" # Debugpy port for VS Code debugging
volumes:
# Mount the entire project directory for development - live code reloading
- ./docker-site:/app
# Mount static volume so Apache can serve static files
- dev_static_volume:/app/static
env_file:
- .env
- .env.oidc
environment:
- DEBUG=1
- DB_HOST=dev-mysql-db
- DB_NAME=${DB_NAME}_dev
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_PORT=${DB_PORT}
- SECRET_KEY=${SECRET_KEY}
- ALLOWED_HOSTS=${ALLOWED_HOSTS}
- TZ=${TZ}
- CELERY_BROKER_URL=redis://dev-redis:6379/0
- CELERY_RESULT_BACKEND=redis://dev-redis:6379/0
- CACHE_URL=${CACHE_URL:-redis://dev-redis:6379/1}
- IRIS_API_BASE_URL=${IRIS_API_BASE_URL}
- IRIS_API_USERNAME=${IRIS_API_USERNAME}
- IRIS_API_PASSWORD=${IRIS_API_PASSWORD}
depends_on:
dev-mysql-db:
condition: service_healthy
dev-redis:
condition: service_healthy
restart: unless-stopped
networks:
- dev-network
- shared-network
# Celery Worker Service (Development)
dev-celery-worker:
build:
context: .
dockerfile: Dockerfile.celery
volumes:
- ./docker-site:/app
env_file:
- .env
environment:
- DEBUG=1
- DB_HOST=dev-mysql-db
- DB_NAME=${DB_NAME}_dev
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_PORT=${DB_PORT}
- SECRET_KEY=${SECRET_KEY}
- CELERY_BROKER_URL=redis://dev-redis:6379/0
- CELERY_RESULT_BACKEND=redis://dev-redis:6379/0
- CACHE_URL=${CACHE_URL:-redis://dev-redis:6379/1}
- TZ=${TZ}
- IRIS_API_BASE_URL=${IRIS_API_BASE_URL}
- IRIS_API_USERNAME=${IRIS_API_USERNAME}
- IRIS_API_PASSWORD=${IRIS_API_PASSWORD}
depends_on:
dev-mysql-db:
condition: service_healthy
dev-redis:
condition: service_healthy
restart: unless-stopped
deploy:
replicas: 2
networks:
- dev-network
# Celery Beat Service (Development)
dev-celery-beat:
build:
context: .
dockerfile: Dockerfile.beat
volumes:
- ./docker-site:/app
env_file:
- .env
environment:
- DEBUG=1
- DB_HOST=dev-mysql-db
- DB_NAME=${DB_NAME}_dev
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_PORT=${DB_PORT}
- SECRET_KEY=${SECRET_KEY}
- CELERY_BROKER_URL=redis://dev-redis:6379/0
- CELERY_RESULT_BACKEND=redis://dev-redis:6379/0
- CACHE_URL=${CACHE_URL:-redis://dev-redis:6379/1}
- TZ=${TZ}
- IRIS_API_BASE_URL=${IRIS_API_BASE_URL}
- IRIS_API_USERNAME=${IRIS_API_USERNAME}
- IRIS_API_PASSWORD=${IRIS_API_PASSWORD}
depends_on:
dev-mysql-db:
condition: service_healthy
dev-redis:
condition: service_healthy
restart: unless-stopped
networks:
- dev-network
# Development Apache (HTTP only, configurable host port)
apache-dev:
build:
context: .
dockerfile: Dockerfile.apache.dev
ports:
- "${DEV_APACHE_PORT:-8080}:80"
volumes:
- dev_static_volume:/var/www/html/static-dev
depends_on:
- dev-django-app
restart: unless-stopped
networks:
- shared-network