-
Notifications
You must be signed in to change notification settings - Fork 38
/
docker-compose.yml
56 lines (54 loc) · 1.25 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
services:
redis:
image: redis
restart: unless-stopped
container_name: $APP_NAME-redis
expose:
- 6379
networks:
- default
nginx:
image: nginx:stable-alpine
container_name: $APP_NAME-nginx
restart: unless-stopped
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- ./media:/www/media:ro
- static_volume:/www/static-dist:ro
ports:
- ${APP_PORT}:8001
depends_on:
- redis
- app
networks:
- default
app:
image: ${APP_IMAGE_NAME}:${APP_IMAGE_TAG}
container_name: $APP_NAME-app
build: .
restart: always
environment:
- ENVIRONMENT=docker
- URL_PREFIX=
- DEBUG=false
# command: python src/manage.py runserver 0.0.0.0:8000
command: >
sh -c "
echo 'Starting the application...' &&
cp -r /project/static-dist/* /project/static-volume/ &&
exec daphne -b 0.0.0.0 -p 8000 -v 3 --proxy-headers config.asgi:application
"
volumes:
- ./media:/project/media
- ./src:/project/src
- ./db.sqlite3:/project/db.sqlite3
- static_volume:/project/static-volume
depends_on:
- redis
networks:
- default
volumes:
static_volume:
networks:
default:
name: $APP_NAME