2 FROM node:lts-alpine as build-stage
7 RUN yarn install --frozen-lockfile
12 # Multi arch build support
15 ARG QEMU_VERSION="v4.2.0-7"
17 RUN wget https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_VERSION}/qemu-aarch64-static && chmod +x qemu-aarch64-static
20 FROM arm64v8/alpine:3.11
22 COPY --from=qemu qemu-aarch64-static /usr/bin/
30 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
31 apk add -U --no-cache darkhttpd su-exec && \
32 rm /usr/bin/qemu-aarch64-static
34 COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
35 COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets
36 COPY entrypoint.sh /entrypoint.sh
38 HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
39 CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1
43 ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]