diff --git a/.dockerignore b/.dockerignore index e1138c61..72305a78 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1 @@ -public/env.sample.js -public/workbox-*.js -public/workbox-*.js.map \ No newline at end of file +public/env.sample.js \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c6e4e19f..f0e4c601 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 7f7cb378..cd0ef5b7 100644 --- a/nginx.conf +++ b/nginx.conf @@ -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; }