赞
踩
1
2
3
4
5
6
7
8
9
10
11
|
kytwb@continuous:~
/path/to/
<project>/$
ls
-la
total 40
drwxrwxr-x 11 kytwb amine 4096 Mar 14 16:30 .
drwxr-xr-x 4 kytwb amine 4096 Nov 1 20:17 ..
drwxr-xr-x 20 kytwb amine 4096 Mar 11 14:24 api
drwxr-xr-x 11 kytwb amine 4096 Mar 3 13:21 cpanel
drwxr-xr-x 10 kytwb amine 4096 Mar 12 11:37 dashboard
-rw-r--r-- 1 kytwb amine 2302 Mar 2 15:28 docker-compose.yml
drwxrwxr-x 9 kytwb amine 4096 Mar 14 16:30 .git
-rw-r--r-- 1 kytwb amine 648 Dec 22 17:20 .gitmodules
-rw-r--r-- 1 kytwb amine 1706 Dec 17 16:41 README.md
|
1
2
3
4
5
6
7
|
$ git -
v
$ docker -
v
$ docker-compose -
v
$ git clone git@bitbucket.com:<project>
/development
.git <project> &&
cd
<project>
$ git submodule init && git submodule update
$ git submodule foreach npm
install
$ docker-compose up -d
|
1
2
3
|
$ git -
v
$ docker -
v
$ docker-compose
|
1
|
$ git clone git@bitbucket.com:<project>
/development
.git <project> &&
cd
<project>
|
1
2
3
|
$ git submodule add git@bitbucket.org:<project>
/api
.git
$ git submodule add git@bitbucket.org:<project>
/dashboard
.git
$ git submodule add git@bitbucket.org:<project>
/cpanel
.git
|
1
|
$ git submodule init && git submodule update
|
1
2
|
api:
image: dockerfile
/nodejs
|
1
2
3
4
5
6
7
8
|
api:
image: dockerfile
/nodejs
volumes:
- .
/api/
:
/app/
working_dir:
/app/
command
: npm start
ports:
-
"8000:8000"
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
api:
image: dockerfile
/nodejs
volumes:
- .
/api/
:
/app/
working_dir:
/app/
command
: npm start
ports:
-
"8000:8000"
links:
- database
database:
image: postgresql
ports:
-
"5432:5432"
|
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
|
- .
/api/
:
/app/
working_dir:
/app/
command
: npm start
ports:
-
"8000:8000"
links:
- database
database:
image: postgresql
dashboard:
image: dockerfile
/nodejs
volumes:
- .
/dashboard/
:
/app/
working_dir:
/app/
command
: npm start
ports:
-
"8001:8001"
links:
- api
cpanel:
image: dockerfile
/nodejs
volumes:
- .
/api/
:
/app/
working_dir:
/app/
command
: npm start
ports:
-
"8002:8002"
links:
- api
|
1
2
3
4
5
6
7
8
9
10
11
12
|
kytwb@continuous:~
/path/to/
<project>$ docker-compose up -d
Recreating <project>_database_1...
Recreating <project>_api_1...
Creating <project>_dashboard_1...
Creating <project>_cpanel_1...
kytwb@continuous:~
/path/to/
<project>$ docker-compose
ps
Name Command State Ports
----------------------------------------------------------------------------------
<project>_api_1 npm start Up 0.0.0.0:8000->8000
/tcp
<project>_dashboard_1 npm start Up 0.0.0.0:8001->8001
/tcp
<project>_cpanel_1 npm start Up 0.0.0.0:8002->8002
/tcp
<project>_database_1
/usr/local/bin/run
Up 0.0.0.0:5432->5432
/tcp
|
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
|
api:
image: dockerfile
/nodejs
volumes:
- .
/api/
:
/app/
working_dir:
/app/
command
: npm start
environment:
- VIRTUAL_HOST=api.domain.
local
- VIRTUAL_PORT=8000
ports:
-
"8000:8000"
links:
- database
database:
image: postgresql
dashboard:
image: dockerfile
/nodejs
volumes:
- .
/dashboard/
:
/app/
working_dir:
/app/
command
: npm start
environment:
- VIRTUAL_HOST=dashboard.domain.
local
- VIRTUAL_PORT=8001
ports:
-
"8001:8001"
links:
- api
cpanel:
image: dockerfile
/nodejs
volumes:
- .
/api/
:
/app/
working_dir:
/app/
command
: npm start
environment:
- VIRTUAL_HOST=cpanel.domain.
local
- VIRTUAL_PORT=8002
ports:
-
"8002:8002"
links:
- api
nginx:
image: jwilder
/nginx-proxy
volumes:
-
/var/run/docker
.sock:
/tmp/docker
.sock
ports:
-
"80:80"
|
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。