-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathdocker-compose2.yml
66 lines (56 loc) · 1.21 KB
/
docker-compose2.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
version: '2'
services:
dev:
container_name: sailsSample_dev
image: agileworks/sails_sample_env
command: "/bin/sh -l -c 'npm i && npm start'"
environment:
PORT: "1337"
NODE_ENV: "development"
DOMAIN_HOST: "localhost:1337"
ports:
- "8000:1337"
working_dir: /sailsSample
volumes:
- ./:/sailsSample
depends_on:
- "mysql"
networks:
- front-tier
- back-tier
mysql:
container_name: mysql
image: dgraziotin/mysql
expose:
- "3306"
environment:
MYSQL_ADMIN_PASS: "root"
MYSQL_USER_NAME: "nodejsSample"
MYSQL_USER_DB: "nodejsSample"
MYSQL_USER_PASS: "nodejsSample"
CREATE_MYSQL_BASIC_USER_AND_DB: "true"
volumes:
- mysql-data:/var/lib/mysql/
networks:
- back-tier
backup:
image: ubuntu
volumes:
- ./:/backup
- mysql-data:/dbdata
command: "tar cvf /backup/backup.tar /dbdata"
restore:
image: ubuntu
volumes:
- ./:/backup
- mysql-data:/dbdata
working_dir: /dbdata
command: "tar xvf /backup/backup.tar --strip 1"
volumes:
mysql-data:
driver: local
networks:
front-tier:
driver: bridge
back-tier:
driver: bridge