Skip to content

Commit 95ba849

Browse files
committed
Docker nodejs speedup.
1 parent f420aa6 commit 95ba849

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

Dockerfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# base image
22
FROM node:10.5.0-slim
33

4+
VOLUME /usr/src/app/
5+
VOLUME /usr/src/app/packages/api/node_modules/
6+
47
WORKDIR /usr/src/app
58

69
# install global dependencies
7-
RUN npm install pm2 -g
10+
RUN npm install pm2 -g
11+
12+
EXPOSE 80

docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ services:
1111
api:
1212
build: .
1313
volumes:
14-
- .:/usr/src/app/
14+
- .:/usr/src/app/:cached
15+
- /usr/src/app/packages/api/node_modules/
1516
ports:
1617
- '8080:80'
1718
environment:

packages/api/ecosystem.config.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,8 @@ module.exports = {
33
{
44
name: 'API',
55
script: 'server.js',
6-
interpreter: 'babel-node',
76
watch: true,
8-
ignore_watch : ['node_modules'],
9-
env: {
10-
NODE_ENV: 'development',
11-
node_args: [
12-
'--inspect=0.0.0.0:9229',
13-
],
14-
},
7+
ignore_watch: ['node_modules'],
158
},
169
],
17-
};
10+
};

0 commit comments

Comments
 (0)