-
Notifications
You must be signed in to change notification settings - Fork 17
/
docker-compose.yml
49 lines (45 loc) · 1.51 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
version: '2'
services:
# Nginx proxy server. It will serve static files and redirect all other
# requests to the Django Codeschool application. Both containers communicate
# using a TCP connection on port 8000.
nginx:
image: nginx:1.11
container_name: nginx_proxy
volumes:
- ./docker/nginx.conf:/etc/nginx/nginx.conf
- ./collect/media/:/var/www/media/
- ./collect/static/:/var/www/static/
- ./docker/sock/:/tmp/sock/
depends_on:
- webapp
ports:
- '80:80'
# Codeschool app serves the dynamic pages. It has to communicate with the
# underlying services using the default ports.
webapp:
image: "cslms/codeschool:${TAG}"
container_name: codeschool-app
volumes:
- ./collect/media/:/app/collect/media/
- ./src/:/app/src/
- ./log/:/app/log/
- ./docker/volumes/db/:/app/db/
- ./docker/sock/:/tmp/sock/
environment:
- CODESCHOOL_PRODUCTION=true
- REDIS_SERVER=redis
- LANG=C.UTF-8
depends_on:
- redis
links:
- redis
command: bash -c "python3 manage.py makemigrations && python3 manage.py migrate && gunicorn codeschool.wsgi -b unix:///tmp/sock/webapp.sock --reload -w 4"
# Redis database
redis:
image: redis:3
container_name: redis_db
volumes:
- ./docker/volumes/redis/:/data/
ports:
- '6379:6379'