-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
54 lines (51 loc) · 1.29 KB
/
docker-compose.yml
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
version: "3.8"
services:
postgres:
image: postgres:15.2-alpine
container_name: django_tenants_db
healthcheck:
test: nc -z localhost 5432
volumes:
- ./postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASS}
- POSTGRES_DB=${POSTGRES_DB}
- DATABASE_PORT=${DB_PORT}
ports:
- "5433:5432"
nginx:
build:
context: ./nginx
depends_on:
- local
ports:
- "80:80"
volumes:
- ./nginx/conf.d/:/etc/nginx/conf.d/
- staticfiles:/home/app/staticfiles
local:
image: django-webapp:0.0.1
build:
context: .
depends_on:
- postgres
env_file:
- .env
environment:
- DEBUG=1
- DB_HOST=postgres
command:
- /bin/sh
- -c
- |
while ! nc -q 1 postgres 5432 </dev/null; do sleep 5; done
python3 manage.py collectstatic --noinput
python3 manage.py makemigrations && python3 manage.py migrate
python3 create_public_tenant.py
gunicorn restaurant_saas.wsgi:application --bind 0.0.0.0:8000
volumes:
- staticfiles:/usr/src/app/staticfiles
container_name: django_multi_tenant
volumes:
staticfiles: