This repository has been archived by the owner on Jun 25, 2021. It is now read-only.
/
docker-compose.yml
78 lines (73 loc) · 2.73 KB
/
docker-compose.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
67
68
69
70
71
72
73
74
75
76
77
78
version: "3.7"
services:
mysql-db:
image: mysql/mysql-server:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: dbuser
MYSQL_PASSWORD: dbuserpwd
MYSQL_DATABASE: boilerplate_db
ports:
- "3306:3306"
expose:
- "3306"
volumes:
- db_data:/var/lib/mysql
networks:
- boilerplate-network
node-app:
build:
context: ./server
dockerfile: Dockerfile
depends_on:
- mysql-db
ports:
- "5000:5000"
expose:
- "5000"
volumes:
- ./server:/opt/app:delegated
# bind-mounting these two files in will let you add packages during development without rebuilding
# for example, to add bower to your app while developing, just install it inside the container
# and then nodemon will restart. Your changes will last until you "docker-compose down" and will
# be saved on host for next build
# docker-compose exec node npm install --save bower
- ./server/package.json:/opt/package.json
- ./server/package-lock.json:/opt/package-lock.json
# this is a workaround to prevent host node_modules from accidently getting mounted in container
# in case you want to use node/npm both outside container for test/lint etc. and also inside container
# this will overwrite the default node_modules dir in container so it won't conflict with our
# /opt/node_modules location. Thanks to PR from @brnluiz
- notused:/opt/app/node_modules
networks:
- boilerplate-network
web-client:
build:
context: ./web-client
dockerfile: Dockerfile
ports:
- "80:3000"
expose:
- "3000"
volumes:
- ./web-client:/opt/app:delegated
# bind-mounting these two files in will let you add packages during development without rebuilding
# for example, to add bower to your app while developing, just install it inside the container
# and then nodemon will restart. Your changes will last until you "docker-compose down" and will
# be saved on host for next build
# docker-compose exec node npm install --save bower
- ./web-client/package.json:/opt/package.json
- ./web-client/package-lock.json:/opt/package-lock.json
# this is a workaround to prevent host node_modules from accidently getting mounted in container
# in case you want to use node/npm both outside container for test/lint etc. and also inside container
# this will overwrite the default node_modules dir in container so it won't conflict with our
# /opt/node_modules location. Thanks to PR from @brnluiz
- notused:/opt/app/node_modules
networks:
- boilerplate-network
volumes:
db_data:
notused:
networks:
boilerplate-network:
driver: bridge