-
Notifications
You must be signed in to change notification settings - Fork 0
/
service.sh
executable file
·43 lines (37 loc) · 1.16 KB
/
service.sh
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
docker network create \
--driver overlay \
--subnet 172.10.0.0/16 \
--opt encrypted \
rpalognet
docker service create \
--name rmq1 \
--mount type=bind,source="${PWD}"/rabbitmq/rabbitmq,destination=/etc/rabbitmq \
--mount type=bind,source="${PWD}"/mnesia/mnesia,destination=/var/lib/rabbitmq/mnesia \
--hostname rmq \
--publish 5672:5672 \
--network rpalognet \
rabbitmq:3.12
sleep 10
docker service create \
--name writer1 \
--mount type=bind,source="${PWD}"/logs,destination=/code/logs \
--hostname writer \
--network rpalognet \
pycode:2.0 python /code/write.py
docker service create \
--name web1 \
--replicas 4 \
--mount type=bind,source="${PWD}"/code/logs,destination=/code/logs \
--mount type=bind,source="${PWD}"/code,destination=/code \
--hostname web \
--publish 8081:8081 \
--network rpalognet \
pycode:2.0 /bin/bash /code/start.sh
docker service create \
--name proxy \
--mount type=bind,source="${PWD}"/nginx/nginx.conf,destination=/etc/nginx/nginx.conf \
--mount type=bind,source="${PWD}"/nginx,destination=/var/cache/nginx \
--mount type=bind,source="${PWD}"/nginx/logs,destination=/var/log/nginx \
--network rpalognet \
-p "80:80" \
proxy:2.0