Skip to content

Commit 1823919

Browse files
committed
Install only production deps in Docker images
1 parent b09dace commit 1823919

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

.dockerignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
node_modules/
1+
node_modules
2+
package-lock.json
3+
npm-debug.log

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ ENV NODE_ENV production
1010

1111
RUN mkdir -p /var/app
1212
WORKDIR /var/app
13+
COPY . /var/app
1314

1415
# Install MsgFlo and dependencies
15-
COPY . /var/app
16-
RUN npm install
16+
RUN npm install --only=production
1717

1818
# Install msgflo-python
1919
RUN apt-get update && apt-get install -y \

Dockerfile-raspberrypi3

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ ENV NODE_ENV production
1010

1111
RUN mkdir -p /var/app
1212
WORKDIR /var/app
13+
COPY . /var/app
1314

1415
# Install MsgFlo and dependencies
15-
COPY . /var/app
16-
RUN npm install
16+
RUN npm install --only=production
1717

1818
# Install msgflo-python
1919
RUN apt-get update && apt-get install -y \

0 commit comments

Comments
 (0)