Skip to content

Instantly share code, notes, and snippets.

@mataprasad
Last active September 28, 2018 11:52
Show Gist options
  • Save mataprasad/dde8b44b62175980f3b6b5d513c5c91a to your computer and use it in GitHub Desktop.
Save mataprasad/dde8b44b62175980f3b6b5d513c5c91a to your computer and use it in GitHub Desktop.
# build stage
FROM node:8-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# production stage
FROM nginx:1.15 as production-stage
RUN unlink /var/log/nginx/access.log && touch /var/log/nginx/access.log \
&& unlink /var/log/nginx/error.log && touch /var/log/nginx/error.log
LABEL "ProductName"="app-sha"
COPY --from=build-stage /app/dist /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
WORKDIR /app
COPY ./nginx.default.conf /etc/nginx/conf.d/default.conf
COPY ./create-env.sh .
COPY ./.env .
RUN chmod +x /app/create-env.sh
ENTRYPOINT bash /app/create-env.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment