Skip to content

Commit

Permalink
Revert "Docker image: serve pre-compressed assets using gzip_static"
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live authored and jryans committed Apr 1, 2021
1 parent ac15f27 commit 0d8d6df
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,14 @@ RUN cp /src/config.sample.json /src/webapp/config.json
# Ensure we populate the version file
RUN dos2unix /src/scripts/docker-write-version.sh && bash /src/scripts/docker-write-version.sh

# Pre-compress for gzip_static
RUN find /src/webapp -type f \
\( -iname '*.css' -o -iname '*.js' -o -iname '*.json' -o -iname '*.html' \
-o -iname '*.svg' -o -iname '*.ttf' -o -iname '*.wasm' \) \
-exec gzip -9 -k {} \; -exec touch -r {} {}.gz \;

# App
FROM nginx:alpine

COPY --from=builder /src/webapp /app

# Insert wasm type into Nginx mime.types file so they load correctly.
RUN sed -i '3i\ \ \ \ application/wasm wasm\;' /etc/nginx/mime.types \
&& sed -i '2i\ gzip_static on\;' /etc/nginx/conf.d/default.conf
RUN sed -i '3i\ \ \ \ application/wasm wasm\;' /etc/nginx/mime.types

RUN rm -rf /usr/share/nginx/html \
&& ln -s /app /usr/share/nginx/html

0 comments on commit 0d8d6df

Please sign in to comment.