-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
90 lines (83 loc) · 1.84 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
version: "3"
services:
frontend:
env_file: client/.env
build:
context: client
dockerfile: Dockerfile
networks:
- default
ports:
- 3000:80
codepad:
restart: always
build: .
env_file: .env
ports:
- 8000:8000
volumes:
- type: volume
source: media
target: /codepad/media/
- type: volume
source: static
target: /codepad/static/
networks:
- default
command: >
bash -c "python3 manage.py migrate
&& python3 manage.py collectstatic --noinput
&& /usr/local/bin/gunicorn CodePad.wsgi:application -b :8000"
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
celery:
build: .
env_file: .env
command: celery worker --app CodePad --loglevel info --queue submissions --broker amqp://$RABBITMQ_DEFAULT_USER:$RABBITMQ_DEFAULT_PASS@$RABBITMQ_DEFAULT_HOST/$RABBITMQ_DEFAULT_VHOST
volumes:
- type: volume
source: media
target: /codepad/media/
networks:
- default
depends_on:
rabbitmq:
condition: service_healthy
postgres:
condition: service_healthy
rabbitmq:
restart: always
env_file: .env
image: rabbitmq:management
ports:
- 5672:5672
- 15672:15672
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 10s
timeout: 10s
retries: 10
postgres:
restart: always
env_file: .env
image: postgres:latest
ports:
- "5433:5432"
volumes:
- pgdbdata:/var/lib/postgresql/data/
healthcheck:
test: pg_isready -d $POSTGRES_DB -p $POSTGRES_PORT -U $POSTGRES_USER
interval: 10s
timeout: 10s
retries: 10
volumes:
pgdbdata:
media:
static:
networks:
default:
external:
name: codenet