Skip to content

Instantly share code, notes, and snippets.

@shri-kanth
Last active July 23, 2019 10:03
Show Gist options
  • Save shri-kanth/92918d87ffcbebd6886dd2544042e444 to your computer and use it in GitHub Desktop.
Save shri-kanth/92918d87ffcbebd6886dd2544042e444 to your computer and use it in GitHub Desktop.
DockerFile to Create Application FrontEnd Image
FROM node:7.7-alpine
# install dependencies
ADD package.json /tmp/package.json
RUN cd /tmp && npm install
# Copy dependencies
RUN mkdir -p /opt/to-do-app && cp -a /tmp/node_modules /opt/to-do-app
# Setup workdir
WORKDIR /opt/to-do-app
RUN mkdir /opt/to-do-app/dist
COPY dist /opt/to-do-app/dist
COPY server.js /opt/to-do-app
COPY initialize.js /opt/to-do-app
# run
EXPOSE 8080
CMD ["sh", "-c", "node initialize && node server"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment