Commit d7a58ad9 authored by Hidde-Jan Jongsma's avatar Hidde-Jan Jongsma

Add production docker file

parent 9cb3be1d
.git
.gitignore
dist
node_modules
Dockerfile
Dockerfile*
.dockerignore
FROM node:lts AS build-stage
# Create Directory for the Container
WORKDIR /app
# Only copy the package.json and yarn.lock to work directory
COPY package.json yarn.lock ./
# Install all Packages
RUN yarn install
# Copy all other source code to work directory
COPY . ./
RUN yarn run build
FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
RUN sed -i \
's|index index.html index.htm;|index index.html;\ntry_files $uri $uri/ /index.html;|' \
/etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment