Skip to content

Instantly share code, notes, and snippets.

@danazkari
Created April 1, 2020 16:05
Show Gist options
  • Save danazkari/ae9d9aab2c913a73f451f7bacdbd8400 to your computer and use it in GitHub Desktop.
Save danazkari/ae9d9aab2c913a73f451f7bacdbd8400 to your computer and use it in GitHub Desktop.
FROM node:12-slim as builder
WORKDIR /usr/src/app
COPY package.json .
COPY yarn*.lock .
RUN yarn --frozen-lockfile
COPY . .
RUN yarn build
FROM nginx:1.16.1-alpine as server
COPY --from=builder /usr/src/app/build /usr/share/nginx/html
COPY --from=builder /usr/src/app/nginx.conf /etc/nginx/conf.d/default.conf
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment