Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jrichardsz
Forked from nileshgulia1/Dockerfile: client
Last active August 25, 2020 03:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrichardsz/b75d305a3b86a5c91a2e6dd77b9371a0 to your computer and use it in GitHub Desktop.
Save jrichardsz/b75d305a3b86a5c91a2e6dd77b9371a0 to your computer and use it in GitHub Desktop.
Docker nodejs client-side snippet
# base image
FROM node:12.2.0-alpine
# set working directory
WORKDIR /app
#copy source code
COPY . /app/
# execute standard nodejs commands
RUN npm install
RUN npm run build
# install the basic server
# replace this line with nginx or apache
RUN npm install -g serve
# /app/my/build/outoput is where npm run build create our assets
# start app
CMD ["serve","-s" "/app/my/build/outoput"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment