-
-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
191 lines (183 loc) · 5.27 KB
/
docker-compose.yml
File metadata and controls
191 lines (183 loc) · 5.27 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
version: '3.8'
services:
jasmin-web:
image: tarekaec/jasmin_web_panel:1.4.4
ports:
- "${JASMIN_WEB_PORT:-8999}:8000"
deploy:
replicas: 1
env_file:
- .env
environment:
DEBUG: 0
DJANGO_SETTINGS_MODULE: config.settings.pro
ALLOWED_HOSTS: '*'
REDIS_URI: redis://redis:6379/1
TELNET_HOST: jasmin
SUBMIT_LOG: 1
volumes:
- web_public:/app/public
- web_logs:/app/logs
depends_on:
- redis
- db
- rabbitmq
restart: unless-stopped
jasmin-celery:
image: tarekaec/jasmin_web_panel:1.4.4
entrypoint: bash ./docker-entrypoint-celery.sh
deploy:
replicas: 1
env_file:
- .env
environment:
DEBUG: 0
DJANGO_SETTINGS_MODULE: config.settings.pro
CELERY_LOG_LEVEL: info
healthcheck:
disable: true
depends_on:
- redis
- db
restart: unless-stopped
redis:
image: redis:alpine
tty: true
volumes:
- redis_data:/data
command:
- 'redis-server'
- '--appendonly yes'
- '--save 10 1'
- '--auto-aof-rewrite-percentage 100'
- '--auto-aof-rewrite-min-size 64mb'
restart: unless-stopped
environment:
REDIS_REPLICATION_MODE: master
ALLOW_EMPTY_PASSWORD: "yes"
healthcheck:
test: redis-cli ping | grep PONG
deploy:
resources:
limits:
cpus: "${REDIS_CPU:-2}"
memory: ${REDIS_MEM:-512M}
security_opt:
- no-new-privileges:true
rabbitmq:
image: rabbitmq:3.10-management-alpine
restart: unless-stopped
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
#RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS: "-ssl_opts.server_name_indication disable"
volumes:
- ./rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: rabbitmq-diagnostics -q ping
deploy:
resources:
limits:
cpus: "${RABBITMQ_CPU:-4}"
memory: ${RABBITMQ_MEM:-1024M}
reservations:
memory: 512M
security_opt:
- no-new-privileges:true
db:
image: postgres:18.0-alpine
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data/
# NOTE: Scripts in /docker-entrypoint-initdb.d run only on first initialization of the data
# directory. For existing postgres_data volumes this init.sql will NOT be applied automatically;
# run the GRANT statements manually (see Troubleshooting in README) or recreate the volume.
- ./config/docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
environment:
POSTGRES_DB: "${POSTGRES_DB:-jasmin}"
POSTGRES_USER: "${POSTGRES_USER:-jasmin}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-jasmin}"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-jasmin}"]
interval: 10s
timeout: 5s
retries: 5
jasmin:
image: jookies/jasmin:latest
restart: unless-stopped
volumes:
- ./jasmin_config/resource:/etc/jasmin/resource
- ./jasmin_config/store:/etc/jasmin/store
- ./jasmin_config:/etc/jasmin
- ./logs:/var/log/jasmin
ports:
- "${JASMIN_SMS_PORT:-2775}:2775"
- "${JASMIN_DASHBOARD_PORT:-8990}:8990"
- "${JASMIN_HTTP_API_PORT:-1401}:1401"
depends_on:
- redis
- rabbitmq
environment:
REDIS_CLIENT_HOST: redis
AMQP_BROKER_HOST: rabbitmq
AMQP_BROKER_PORT: 5672
sysctls:
- net.ipv4.tcp_keepalive_time=60
- net.ipv4.tcp_keepalive_intvl=10
- net.ipv4.tcp_keepalive_probes=5
deploy:
resources:
limits:
cpus: "${JASMIN_CPU:-2}"
memory: ${JASMIN_MEM:-512M}
security_opt:
- no-new-privileges:true
sms_logger:
image: jookies/jasmin:latest
volumes:
- ./jasmin_config/resource:/etc/jasmin/resource
- ./jasmin_config:/etc/jasmin
- ./sms_logger.py:/build/misc/scripts/sms_logger.py:ro
command: bash -c "sleep 15 && pip install -U pip psycopg2-binary mysql-connector-python && exec python /build/misc/scripts/sms_logger.py"
environment:
DB_TYPE_MYSQL: ${DB_TYPE_MYSQL:-0}
AMQP_BROKER_HOST: ${AMQP_BROKER_HOST:-rabbitmq}
AMQP_BROKER_PORT: ${AMQP_BROKER_PORT:-5672}
AMQP_SPEC_FILE: '/etc/jasmin/resource/amqp0-9-1.xml'
AMQP_HEARTBEAT: 60 # Enable 60-second heartbeats
RECONNECT_DELAY: 5 # Initial reconnect delay
MAX_RECONNECT_DELAY: 60 # Max reconnect delay
DB_HOST: ${DB_HOST:-db}
DB_DATABASE: ${DB_DATABASE:-jasmin}
DB_TABLE: ${DB_TABLE:-submit_log}
DB_USER: ${DB_USER:-jasmin}
DB_PASS: ${DB_PASS:-jasmin}
depends_on:
- rabbitmq
- db
- jasmin
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import socket; s=socket.socket(); s.settimeout(2); s.connect(('rabbitmq', 5672)); s.close()"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
sysctls:
net.ipv4.tcp_keepalive_time: 60
net.ipv4.tcp_keepalive_intvl: 10
net.ipv4.tcp_keepalive_probes: 5
volumes:
web_public:
driver: local
web_logs:
driver: local
redis_data:
driver: local
rabbitmq_data:
driver: local
postgres_data:
driver: local
monitoring_data:
driver: local