-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
78 lines (71 loc) · 2.51 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.3"
services:
backend-db:
build: ./backend/mysql
restart: always
# ports to map, YOU CANNOT RUN ANYTHING ELSE ON PORT 3306
ports:
- 3306:3306
# persistant volume
volumes:
# ONLY ONE VOLUME SHOULD BE UNCOMMENTED
# this will store the volume in a docker chosen location on OS, it will be persistent. if you uncomment this line then you must do the same down
# for the "volumes:"" attribute below
- db_vol:/var/lib/mysql
# this will store the volume of the DB in a local path of your choosing, the file starts from the directory level of the docker-compose.yml file
# so in this example it would be in the db folder in the backend folder, it will be persistent.
# - ./backend/mysql/db:/var/lib/mysql
# shared network
networks:
- backend
backend-api:
build: ./backend/node
restart: always
# working directory in container to place files
working_dir: /usr/src/app
# startup command if it takes a long time uncomment line 31 and comment line 30, if you do this
# you must run `yarn` at the package.json level locally prior to starting
command: bash -c "yarn && yarn run dev"
# command: bash -c "yarn run dev"
# map code volumes from local to inside working directory, changes made locally will update into the container
volumes:
- ./backend/node:/usr/src/app
# specify dependency on mysql db
depends_on:
- backend-db
# ports to map, YOU CANNOT RUN ANYTHING ELSE ON PORT 8000
ports:
- 8000:8000
# shared network
networks:
- backend
- frontend
frontend-app:
tty: true
build: ./frontend
restart: always
# working directory in container to place files
working_dir: /usr/src/app
# startup command if it takes a long time uncomment line 51 and comment line 50, if you do this
# you must run `yarn` at the package.json level locally prior to starting
command: bash -c "yarn && yarn start"
# command: bash -c "yarn start"
# map code volumes from local to inside working directory, changes made locally will update into the container
volumes:
- ./frontend:/usr/src/app
# specify dependency on mysql db
depends_on:
- backend-api
# ports to map, YOU CANNOT RUN ANYTHING ELSE ON PORT 3000
ports:
- 3000:3000
# shared network
networks:
- frontend
# specify networks
networks:
backend:
frontend:
# persistent volume, comment all out if not using db_vol above
volumes:
db_vol: