This repository has been archived by the owner on Mar 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathdocker-compose.ci.yml
86 lines (78 loc) · 1.58 KB
/
docker-compose.ci.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
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
version: '3.7'
services:
services:
postgres:
container_name: postgres
image: postgres:11.5
networks:
- main
ports:
- "5434:5432"
volumes:
- pg-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres123
backend: &backend
container_name: backend
build:
context: ./backend
dockerfile: scripts/prod/Dockerfile
command: >
bash -c "
python3 manage.py makemigrations
python3 manage.py migrate --no-input
python3 manage.py create_default_user
gunicorn -t 300 -b 0.0.0.0:8000 backend.wsgi
"
networks:
- main
volumes:
- ./backend:/code
- django-static:/code/static
depends_on:
- postgres
environment:
- SECRET_KEY='secret'
- DEBUG=True
- DJANGO_SETTINGS_MODULE=backend.settings.gitlab-ci
- POSTGRES_PASSWORD=postgres123
asgiserver:
<<: *backend
container_name: asgiserver
command:
- "daphne"
- "backend.asgi:application"
- "--bind"
- "0.0.0.0"
- "--port"
- "9000"
volumes:
- ./backend:/code
nginx:
container_name: nginx
build:
context: .
dockerfile: nginx/ci/Dockerfile
ports:
- 80:80
networks:
- main
volumes:
- django-static:/usr/src/app/static
depends_on:
- backend
redis:
image: redis:alpine
container_name: redis
volumes:
- redis-data:/data
networks:
- main
volumes:
django-static:
portainer-data:
pg-data:
redis-data:
networks:
main:
driver: bridge