🐳 new Dockerfiles

ref #108
This commit is contained in:
Philipp Dormann 2021-03-25 18:55:43 +01:00
parent ae79e9fea1
commit 0f32968fae
3 changed files with 13 additions and 11 deletions

View File

@ -1,3 +1 @@
public/env.sample.js
public/workbox-*.js
public/workbox-*.js.map
public/env.sample.js

View File

@ -1,18 +1,14 @@
FROM node:15.5.1-alpine3.12
WORKDIR /app
RUN npm i -g pnpm
COPY package.json ./
RUN pnpm i
COPY package.json *.config.js workbox-config.js template-copy.js index.template.html s-config.template.js ./
RUN yarn
COPY package.json *.config.js index.html ./
COPY src ./src
COPY public ./public
RUN pnpm run build
RUN yarn build
# final image
FROM alpine
COPY --from=0 /app/build /app
RUN rm -rf /app/build/_dist_/components
RUN rm -rf /app/build/_dist_/locales
RUN rm -rf /app/build-manifest.json
COPY --from=0 /app/dist /app
FROM fholzer/nginx-brotli:v1.19.1
COPY --from=1 /app /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/nginx.conf

View File

@ -6,6 +6,14 @@ http {
server {
error_page 404 /index.html;
root /usr/share/nginx/html;
location = /index.html {
internal;
add_header Cache-Control 'no-store';
}
location = / {
internal;
add_header Cache-Control 'no-store';
}
location / {
try_files $uri $uri/ /index.html;
}