File tree Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change
1
+ node_modules
2
+ .dockerignore
3
+ Dockerfile-dev
Original file line number Diff line number Diff line change
1
+ FROM node:latest
2
+
3
+ # set working directory
4
+ RUN mkdir /usr/src/app
5
+ WORKDIR /usr/src
6
+
7
+ # install and cache app dependencies
8
+ ADD package.json /usr/src/app/package.json
9
+ RUN npm install
10
+
11
+ # add `/usr/src/node_modules/.bin` to $PATH
12
+ ENV PATH /usr/src/node_modules/.bin:$PATH
13
+
14
+ # add app
15
+ COPY . /usr/src/app
16
+
17
+ # start app
18
+ CMD ["npm", "run", "dev]
Original file line number Diff line number Diff line change
1
+ version : " 2.1"
2
+
3
+ services :
4
+ app-db-dev :
5
+ container_name : app-db
6
+ image : mongo
7
+ ports :
8
+ - " 27017:27017"
9
+ healthcheck :
10
+ test : exit 0
11
+
12
+ app-service-dev :
13
+ container_name : app
14
+ build :
15
+ context : ./
16
+ dockerfile : Dockerfile-dev
17
+ volumes :
18
+ - " ./:/usr/src/app"
19
+ - " ./package.json:/usr/src/package.json"
20
+ ports :
21
+ - " 3000:3000"
22
+ environment :
23
+ - MONGO_URL="mongodb://app-db:27017/SampleDB"
24
+ - MONGO_URL_TEST="mongodb://app-db:27017/SampleDB"
25
+ - SESSION_SECRET="xxxxxxx"
26
+ links :
27
+ - app-db-dev
28
+ depends_on :
29
+ app-db-dev :
30
+ condition : service_healthy
You can’t perform that action at this time.
0 commit comments