interview-v1/Dockerfile.client

28 lines
676 B
Docker
Raw Normal View History

2018-07-08 18:17:19 +00:00
FROM node:9.3.0-alpine
# install static server
RUN npm install -g serve
# create a 'tmp' folder for the build and make it the current working directory
WORKDIR /app/tmp
# copy only the package.json to take advantage of cached Docker layers
COPY package.json .
# install project dependencies
RUN npm install
# copy project files and folders to the working directory
COPY . .
# build for production with minification
RUN npm run build
# make the 'app' folder the current working directory
WORKDIR /app
# clean up (i.e. extract 'dist' folder and remove everything else)
RUN mv tmp/dist dist && rm -fr tmp
EXPOSE 5000
CMD [ "serve", "--single", "--port", "3000", "dist" ]