Skip to content

Instantly share code, notes, and snippets.

@sahanasj
Forked from shri-kanth/frontEnd.DockerFile
Created July 23, 2019 10:03
Show Gist options
  • Save sahanasj/a6120645e8eb0319182e79859a78b22f to your computer and use it in GitHub Desktop.
Save sahanasj/a6120645e8eb0319182e79859a78b22f 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