-
Notifications
You must be signed in to change notification settings - Fork 10
/
docker-compose.yaml
78 lines (72 loc) · 2.12 KB
/
docker-compose.yaml
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
version: '3.9'
# If you want to use mysql instead of mongodb, please move the entire mysql
# block from below under `services`. You should then uncomment the
# mysql related env vars in app_svc environment section. Do not forget
# to uncomment mysql-data under volumes.
x-disabled:
mysql:
container_name: mysql
image: mysql:5.7
restart: always
environment:
- MYSQL_DATABASE=$DB_NAME
# Uncomment following line, if root user does not have a
# password. And remove MYSQL_ROOT_PASSWORD
# - MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PWORD
# Uncomment next lines if you have a different user
# than root.
# - MYSQL_USER=$MYSQL_USER
# - MYSQL_PASSWORD=$MYSQL_PWORD
ports:
- $MYSQL_HOST_PORT:$MYSQL_PORT
volumes:
- mysql-data:/var/lib/mysql
networks:
- svc-network
services:
build_image:
build: .
image: services/sns:${VERSION} # use your own image name e.g. rancher/my-app:{VERSION}
app_svc:
container_name: sns-service
image: services/sns:${VERSION}
depends_on: [build_image]
restart: on-failure
environment:
- MONGO_USERNAME=$MONGO_USERNAME
- MONGO_PASSWORD=$MONGO_PASSWORD
- MONGO_HOSTNAME=mongo
- MONGO_PORT=$MONGO_PORT
- MONGO_DB=$DB_NAME
# Uncomment if you are using mysql
# - MYSQL_DB=$DB_NAME
# - MYSQL_HOSTNAME=mysql
# - MYSQL_USER=$MYSQL_ROOT_USER # feel free to use a different user
# - MYSQL_PASSWORD=$MYSQL_ROOT_PWORD
# - MYSQL_PORT=$MYSQL_PORT
ports:
- $SVC_HOST_PORT:8282
networks:
- svc-network
command: bash scripts/startup.sh
mongo:
container_name: mongo
image: mongo:4.1.8-xenial
restart: always
environment:
- MONGO_INITDB_ROOT_USERNAME=$MONGO_USERNAME
- MONGO_INITDB_ROOT_PASSWORD=$MONGO_PASSWORD
- MONGO_INITDB_DATABASE=$DB_NAME
ports:
- $MONGO_HOST_PORT:$MONGO_PORT
volumes:
- mongo-data:/data/db
networks:
- svc-network
networks:
svc-network:
driver: bridge
volumes:
mongo-data:
# mysql-data: # uncomment if using mysql