Using preprocessed icons on production docker images; was able to reduce image size from 170 -> 55MB; merging into develop to evaluate during next dev cycle

This commit is contained in:
Willian Mitsuda 2021-07-09 21:11:52 -03:00
parent 5214f7c95d
commit f79817fc5d
1 changed files with 7 additions and 1 deletions

View File

@ -7,10 +7,16 @@ COPY ["public", "/otterscan-build/public"]
COPY ["src", "/otterscan-build/src"] COPY ["src", "/otterscan-build/src"]
RUN npm run build RUN npm run build
FROM alpine:3.14.0 AS logobuilder
RUN apk add imagemagick parallel
WORKDIR /assets
COPY trustwallet/blockchains/ethereum/assets /assets/
RUN find . -name logo.png | parallel magick convert {} -filter Lanczos -resize 32x32 {}
FROM nginx:1.21.1-alpine FROM nginx:1.21.1-alpine
RUN apk add jq RUN apk add jq
COPY 4bytes/signatures /usr/share/nginx/html/signatures/ COPY 4bytes/signatures /usr/share/nginx/html/signatures/
COPY trustwallet/blockchains/ethereum/assets /usr/share/nginx/html/assets/ COPY --from=logobuilder /assets /usr/share/nginx/html/assets/
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /otterscan-build/build /usr/share/nginx/html/ COPY --from=builder /otterscan-build/build /usr/share/nginx/html/
COPY --from=builder /otterscan-build/run-nginx.sh / COPY --from=builder /otterscan-build/run-nginx.sh /