37 lines
778 B
Docker
37 lines
778 B
Docker
FROM node:lts-alpine AS builder
|
|
|
|
RUN apk add --no-cache --update git
|
|
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
COPY ./ ./
|
|
RUN npm run build
|
|
|
|
FROM nginx:alpine-slim
|
|
COPY <<EOF /etc/nginx/conf.d/default.conf
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name localhost;
|
|
|
|
location / {
|
|
root /usr/share/nginx/html;
|
|
index non-existent-to-prevent-caching.html;
|
|
try_files \$uri @index;
|
|
}
|
|
|
|
location @index {
|
|
root /usr/share/nginx/html;
|
|
add_header Cache-Control no-cache;
|
|
expires 0;
|
|
try_files /index.html =404;
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
}
|
|
EOF
|
|
COPY --from=builder /app/dist /usr/share/nginx/html |