This repo contains Docker image that helps to build SPA.
It's based on node.js and has npm, yarn and node-gyp pre-installed.
It also has gzip and brotli to produce pre-compressed static files ready to be served by nginx.
FROM alexxxnf/spa-builder as builder
COPY ./package.json ./package-lock.json ./yarn.lock /app/
RUN cd /app && yarn
COPY . /app
RUN cd /app \
&& yarn run build --prod \
&& /app/dist \
&& for i in `find | grep -E "\.css$|\.html$|\.js$|\.svg$|\.txt$|\.ttf$"`; do gzip -9kf "$i" && brotli -fZ "$i" ; done
FROM alexxxnf/nginx-spa
COPY --from=builder /app/dist /etc/nginx/html/
Dockerfile can be found on GitHub
Content type
Image
Digest
Size
28.7 MB
Last updated
about 6 years ago
docker pull alexxxnf/spa-builder