-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-example.yml
110 lines (102 loc) · 3.63 KB
/
docker-compose-example.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
110
version: '3'
services:
behavioral_control_service:
image: dzhuang/ikuai_behavioral_control:latest
container_name: behavioral_control
ports:
- 8030:8030
# volumes:
# - ./log:/opt/behavioral_control/log
# - ./local_settings:/opt/behavioral_control/local_settings
environment:
- BEHAVIORAL_CONTROL_SERVER_SECRET_KEY=epouipoigpqeroilijapoiqerpclpourladjfoupuigjladfj2qyqewrozcoilq
# - BEHAVIORAL_CONTROL_SERVER_LANGUAGE_CODE=zh-hans
# - BEHAVIORAL_CONTROL_SERVER_TZ=Asia/Shanghai
- BEHAVIORAL_CONTROL_SERVER_DB_HOST=postgres_db_service
- BEHAVIORAL_CONTROL_SERVER_DB_PORT=5432
- BEHAVIORAL_CONTROL_SERVER_DB_USER=bc_user
- BEHAVIORAL_CONTROL_SERVER_DB_PASSWORD=bc_user_pw
- BEHAVIORAL_CONTROL_SERVER_DB=behavioral_control_db
- BEHAVIORAL_CONTROL_SERVER_DEBUG=off
- BEHAVIORAL_CONTROL_SERVER_REDIS_LOCATION=redis://redis_service:6379
- BEHAVIORAL_CONTROL_ALLOWED_HOST_router=foo.com
- BEHAVIORAL_CONTROL_ALLOWED_HOST_local=192.168.9.1
- BEHAVIORAL_CONTROL_CSRF_TRUSTED_ORIGINS_router=https://foo.com
- BEHAVIORAL_CONTROL_CSRF_TRUSTED_ORIGINS_local=http://192.168.9.1
- DJANGO_SUPERUSER_USERNAME=pc_test
- DJANGO_SUPERUSER_PASSWORD=pc_test
- DJANGO_SUPERUSER_EMAIL=blabal@example.com
- RABBITMQ_HOST=pc_rabbit_host
- RABBITMQ_USER=pc_rabbit
- RABBITMQ_PASSWORD=pc_rabbit
depends_on:
- redis_service
- rabbit
restart: always
labels:
- "com.centurylinklabs.watchtower.scope=ikuai_behavioral_control"
postgres_db_service:
image: postgres:14
environment:
- POSTGRES_USER=bc_user
- POSTGRES_PASSWORD=bc_user_pw
- POSTGRES_DB=behavioral_control_db
volumes:
- postgres_data:/var/lib/postgresql/data/
restart: always
# RabbitMQ
rabbit:
hostname: pc_rabbit_host
image: rabbitmq:3.6.9
environment:
- RABBITMQ_DEFAULT_USER=pc_rabbit
- RABBITMQ_DEFAULT_PASS=pc_rabbit
ports:
- "5672:5672"
- "15672:15672"
restart: always
redis_service:
image: redis:alpine
restart: always
volumes:
- redis_data:/data
celery:
# volumes:
# - ./log:/opt/behavioral_control/log
# - ./local_settings:/opt/behavioral_control/local_settings
image: dzhuang/ikuai_behavioral_control:latest
container_name: behavioral_control_celery
command: celery -A behavioral_control worker --beat -l INFO
environment:
- BEHAVIORAL_CONTROL_SERVER_DEBUG=off
- BEHAVIORAL_CONTROL_SERVER_REDIS_LOCATION=redis://redis_service:6379
- BEHAVIORAL_CONTROL_SERVER_DB_HOST=postgres_db_service
- BEHAVIORAL_CONTROL_SERVER_DB_PORT=5432
- BEHAVIORAL_CONTROL_SERVER_DB_USER=bc_user
- BEHAVIORAL_CONTROL_SERVER_DB_PASSWORD=bc_user_pw
- BEHAVIORAL_CONTROL_SERVER_DB=behavioral_control_db
- RABBITMQ_HOST=pc_rabbit_host
- RABBITMQ_USER=pc_rabbit
- RABBITMQ_PASSWORD=pc_rabbit
depends_on:
- behavioral_control_service
- postgres_db_service
- redis_service
- rabbit
restart: always
labels:
- "com.centurylinklabs.watchtower.scope=ikuai_behavioral_control"
# Enable image/container auto update
# watchtower:
# image: containrrr/watchtower
# container_name: watchtower_behavioral_control
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# environment:
# WATCHTOWER_MONITOR_ONLY: 'true'
# command: --cleanup --interval 30 behavioral_control, behavioral_control_celery
# labels:
# - "com.centurylinklabs.watchtower.scope=ikuai_behavioral_control"
volumes:
redis_data:
postgres_data: