File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 22# https://nodejs.org/en/docs/guides/nodejs-docker-webapp/
33# https://github.com/nodejs/docker-node
44
5+ # Node.js base image
6+ FROM node:8
7+
58# default NODE_ENV for building the app (clientside JS etc.)
69ARG NODE_ENV=production
710
811# default NODE_ENV for running the server
912ENV NODE_ENV=production
1013
11- # Node.js base image
12- FROM node:8
13-
1414# Create an unprivileged user w/ home directory
1515RUN groupadd appuser \
1616 && useradd --gid appuser --shell /bin/bash --create-home appuser
@@ -23,7 +23,8 @@ WORKDIR /home/appuser/app
2323COPY . /home/appuser/app
2424
2525# Install app dependencies
26- RUN npm install
26+ # Note: must be development so that dev deps are installed
27+ RUN NODE_ENV=development npm install
2728
2829# Build project
2930RUN npm run clean
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ docker build --build-arg NODE_ENV=production -t app-ui .
7878Run the container:
7979
8080```
81- docker run -it --rm -p 12345:3000 -u "appuser" - e "NODE_ENV=production" --name "app-ui" app-ui:local
81+ docker run -it --rm -p 12345:3000 -e "NODE_ENV=production" --name "app-ui" app-ui
8282```
8383
8484Notes:
You can’t perform that action at this time.
0 commit comments