Skip to content

Instantly share code, notes, and snippets.

@bsod90
Last active September 10, 2017 17:44
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 bsod90/b86280a11939097472b21e7b092ef1a5 to your computer and use it in GitHub Desktop.
Save bsod90/b86280a11939097472b21e7b092ef1a5 to your computer and use it in GitHub Desktop.
Dockerfile after multi-stage
# First, build the Ember-js project inside nodejs container
FROM node:6
RUN mkdir -p /onebar/ui
RUN npm install -g ember-cli
RUN npm install -g bower
RUN echo ‘{ “allow_root”: true }’ > /root/.bowerrc
ADD ui/package.json /onebar/ui/package.json
WORKDIR /onebar/ui
RUN npm install
ADD ui/ /onebar/ui
RUN bower install
RUN ember build — environment=production
# Then start a new image from the nginx one and copy build
# artifacts from the first stage. Everything else from the first
# stage will be left out from the final image.
FROM nginx
RUN mkdir -p /onebar/ui
ADD ./deploy/configs/nginx/docker.conf /etc/nginx/nginx.conf
ADD ./deploy/configs/nginx/k8s.conf /etc/nginx/nginx.conf.k8s
ADD ./deploy/nginx-entrypoint.sh /root/nginx-entrypoint.sh
ADD ./onebar/static /onebar/static
# Copy build artifacts from the first stage
COPY — from=0 /onebar/ui/dist /onebar/ui/dist
WORKDIR /onebar/ui
CMD [ “/root/nginx-entrypoint.sh”, “nginx”, “-g”, “daemon off;” ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment