forked from Prescrypto/RexChain
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
58 lines (53 loc) · 1.21 KB
/
docker-compose.yml
File metadata and controls
58 lines (53 loc) · 1.21 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
version: '3.8'
services:
# PostgreSQL Database
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: mydb
POSTGRES_USER: vagrant
POSTGRES_PASSWORD: vagrant
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
# Redis Cache
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
# Django Web Application
web:
build: .
command: >
sh -c "echo 'Starting database setup...' &&
python rexchain/manage.py migrate --verbosity=2 &&
echo 'Loading fixtures...' &&
python rexchain/manage.py loaddata ./rexchain/fixtures/initial_data.json --verbosity=2 &&
echo 'Starting server...' &&
python rexchain/manage.py runserver 0.0.0.0:8000"
volumes:
- .:/app
ports:
- "8000:8000"
env_file:
- config/docker.env
depends_on:
- db
- redis
# RQ Worker for background tasks
worker:
build: .
command: python rexchain/manage.py rqworker high default low
volumes:
- .:/app
env_file:
- config/docker.env
depends_on:
- db
- redis
volumes:
postgres_data:
redis_data: