mirror of
https://github.com/vector-im/element-call.git
synced 2026-03-31 07:00:26 +00:00
Don't produce compressed assets at build time and instead do it as part of the nginx build
The core vite build shouldn't be responsible for implementing optimisations that are specific to a particular distribution mechanism. e.g. static compressed files for nginx. This way the core build is "clean". Instead, the packager/distributor of the build should be responsible for it. e.g. the nginx docker distribution should do any optimisations that it chooses.
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -1,4 +1,13 @@
|
||||
FROM alpine AS builder
|
||||
|
||||
COPY ./dist /dist
|
||||
|
||||
# Compress assets to work with nginx-gzip-static-module
|
||||
WORKDIR /dist/assets
|
||||
RUN gzip -k ../index.html *.js *.map *.css *.wasm *-app-*.json
|
||||
|
||||
FROM nginxinc/nginx-unprivileged:alpine
|
||||
|
||||
COPY ./dist /app
|
||||
COPY --from=builder ./dist /app
|
||||
|
||||
COPY config/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
Reference in New Issue
Block a user