-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
109 lines (107 loc) · 2.65 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
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
version: '3.4'
services:
django-common:
build:
context: .
dockerfile: docker-files/app/common.Dockerfile
image: lms-backend-django-prod-deps
command: /bin/true
uwsgi:
container_name: lms-django
build:
context: .
dockerfile: docker-files/app/Dockerfile
args:
- BASE_IMAGE=lms-backend-django-prod-deps
- FRONTEND_IMAGE=lms-webpack-bundles
- DJANGO_STATIC_ROOT=/var/www/static/
- SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}
image: lms-backend-django
restart: always
environment:
- DATABASE_URL=postgresql://csc:FooBar@db:5432/cscdb
- PROJECT_MODULE_NAME=compscicenter_ru
- REDIS_HOST=lms-redis-cluster
- REDIS_PASSWORD=secret-password
volumes:
- static-data:/var/www/static
depends_on:
- db
- redis
- django-common
django-tests:
container_name: lms-django-tests
build:
context: .
dockerfile: docker-files/app/dev.Dockerfile
args:
- BASE_IMAGE=lms-backend-django-prod-deps
image: lms-backend-django-tests
environment:
- PROJECT_MODULE_NAME=compscicenter_ru
- REDIS_HOST=lms-redis-cluster
- REDIS_PASSWORD=secret-password
depends_on:
- db
- redis
- uwsgi
rqworker:
container_name: lms-task-queue
image: lms-backend-django
restart: always
environment:
- DEBUG=0
- REDIS_HOST=lms-redis-cluster
- REDIS_PASSWORD=secret-password
command: python manage.py rqworker high default
depends_on:
- uwsgi
nginx:
container_name: lms-nginx
build:
context: ./docker-files/nginx
dockerfile: Dockerfile
image: lms-backend-nginx
ports:
- "80:80"
volumes:
- static-data:/var/www/static
- media-data:/var/www/media
depends_on:
- redis
- uwsgi
db:
container_name: db
image: postgres:12-alpine
restart: always
environment:
POSTGRES_USER: csc
POSTGRES_DB: cscdb
POSTGRES_PASSWORD: FooBar
volumes:
- postgres-data:/var/lib/postgresql/data/
redis:
container_name: lms-redis-cluster
image: "redis:6-alpine"
command: sh -c 'if [ "x$${REDIS_PASSWORD}" = "x" ]; then redis-server --appendonly yes; else redis-server --appendonly yes --requirepass $$REDIS_PASSWORD; fi'
expose:
- 6379
volumes:
- redis-data:/data
environment:
- REDIS_PASSWORD=secret-password
volumes:
static-data:
media-data:
name: lms-media
external: true
redis-data:
name: lms-redis-data
external: true
postgres-data:
lms-repository:
driver: local
driver_opts:
o: bind
type: none
device: .