blob: bca90e201a53fd261694ace72e6a7c27340d59d4 [file] [log] [blame]
Chandan Ghosh5d55c412019-04-09 15:18:05 +05301# Check out https://hub.docker.com/_/node to select a new base image
2FROM node:10-slim
3
4# Set to a non-root built-in user `node`
5USER node
6
7# Create app directory (with user `node`)
8RUN mkdir -p /home/node/app
9
10WORKDIR /home/node/app
11
12# Install app dependencies
13# A wildcard is used to ensure both package.json AND package-lock.json are copied
14# where available (npm@5+)
15COPY --chown=node package*.json ./
16
17RUN npm install
18
19# Bundle app source code
20COPY --chown=node . .
21
22RUN npm run build
23
24# Bind to all network interfaces so that it can be mapped to the host OS
25ENV HOST=0.0.0.0 PORT=3000
26
27EXPOSE ${PORT}
28CMD [ "node", "." ]