-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
170 lines (156 loc) · 4.25 KB
/
Copy pathdocker-compose.yml
File metadata and controls
170 lines (156 loc) · 4.25 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
services:
web:
build: .
volumes:
- .:/app
# For production: daphne -b 0.0.0.0 -p 8000 --access-log - --verbosity 1 mysite.asgi:application
# For debug: python -Xfrozen_modules=off -m debugpy --listen 0.0.0.0:5678 -m daphne -b 0.0.0.0 -p 8000 mysite.asgi:application
command: >
sh -c "
python manage.py migrate &&
python manage.py collectstatic --noinput &&
watchfiles 'daphne -b 0.0.0.0 -p 8000 mysite.asgi:application' /app
"
ports:
- "8000:8000" # ✅ only required exposed port
environment:
- DEBUG=True
- OTP_VERIFICATION_ENABLED=False
- DJANGO_SETTINGS_MODULE=mysite.settings.dev
# Postgres
- DB_HOST=db
- DB_PORT=5432
- POSTGRES_DB=bizbuch
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
# Redis
- REDIS_HOST=redis
# S3 (MinIO)
- AWS_ACCESS_KEY_ID=bizbuch_admin
- AWS_SECRET_ACCESS_KEY=bizbuch_secret_key
- AWS_S3_ENDPOINT_URL=http://minio:9000
- AWS_S3_BUCKET=bizbuch
- AWS_DEFAULT_REGION=us-east-1
- AWS_S3_USE_SSL=False
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
minio:
condition: service_started
minio_init:
condition: service_completed_successfully
networks:
bizbuch_network:
ipv4_address: 172.28.0.10
db:
image: postgres:15
restart: always
environment:
POSTGRES_DB: bizbuch
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# Optional: expose Postgres port only if needed for external access
# ports:
# - "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d bizbuch"]
interval: 5s
timeout: 3s
retries: 20
networks:
bizbuch_network:
ipv4_address: 172.28.0.11
redis:
image: redis:7-alpine
restart: always
# Optional: expose Redis port only if needed for external access
# ports:
# - "6379:6379"
networks:
bizbuch_network:
ipv4_address: 172.28.0.12
redisinsight:
image: redis/redisinsight:latest
container_name: redisinsight
restart: always
# ports:
# - "5540:5540"
depends_on:
- redis
networks:
bizbuch_network:
ipv4_address: 172.28.0.17
minio:
image: minio/minio:latest
container_name: minio
restart: always
environment:
MINIO_ROOT_USER: bizbuch_admin
MINIO_ROOT_PASSWORD: bizbuch_secret_key
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
# Optional: expose MinIO ports only if needed for UI/debugging
# ports:
# - "9000:9000"
# - "9001:9001"
networks:
bizbuch_network:
ipv4_address: 172.28.0.13
minio_init:
image: minio/mc:latest
depends_on:
- minio
restart: "no"
entrypoint: >
/bin/sh -c "
until (/usr/bin/mc alias set myminio http://minio:9000 bizbuch_admin bizbuch_secret_key) do sleep 2; done;
/usr/bin/mc mb -p myminio/bizbuch || true;
/usr/bin/mc anonymous set download myminio/bizbuch || true;
exit 0;
"
networks:
bizbuch_network:
ipv4_address: 172.28.0.14
# pgadmin:
# image: dpage/pgadmin4:latest
# container_name: pgadmin
# restart: always
# environment:
# PGADMIN_DEFAULT_EMAIL: admin@admin.com
# PGADMIN_DEFAULT_PASSWORD: admin
# PGADMIN_CONFIG_SERVER_MODE: "False"
# PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: "False"
# ports:
# - "5050:80"
# volumes:
# - ./pgadmin/servers.json:/pgadmin4/servers.json:ro
# depends_on:
# - db
# networks:
# bizbuch_network:
# ipv4_address: 172.28.0.16
# Uncomment the following section to enable Cloudflare Tunnel
# tunnel:
# image: cloudflare/cloudflared:latest
# command: tunnel --no-autoupdate --url http://web:8000
# restart: always
# depends_on:
# - web
# networks:
# bizbuch_network:
# ipv4_address: 172.28.0.15
volumes:
postgres_data:
minio_data:
networks:
bizbuch_network:
driver: bridge
ipam:
config:
- subnet: 172.28.0.0/16
gateway: 172.28.0.1