X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=Dockerfile.arm32v7;h=1621abb74800d55809dd3d3cc80eea59563e3224;hb=6173d7df609bc3ab071d5d9e34ce1eb1cb05d99e;hp=3b182437fc1a2a970df6e6822f41cc2604653a52;hpb=2b47d9146476b75734a1f1c3da957fa093294dce;p=github%2Fbastienwirtz%2Fhomer.git diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 index 3b18243..1621abb 100644 --- a/Dockerfile.arm32v7 +++ b/Dockerfile.arm32v7 @@ -1,23 +1,43 @@ +# build stage +FROM node:lts-alpine as build-stage + +WORKDIR /app + +COPY package*.json ./ +RUN yarn install --frozen-lockfile + +COPY . . +RUN yarn build + +# Multi arch build support FROM alpine as qemu ARG QEMU_VERSION="v4.2.0-7" RUN wget https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_VERSION}/qemu-arm-static && chmod +x qemu-arm-static +# production stage FROM arm32v7/alpine:3.11 COPY --from=qemu qemu-arm-static /usr/bin/ -COPY ./ /www/ ENV USER darkhttpd ENV GROUP darkhttpd ENV GID 911 ENV UID 911 +ENV PORT 8080 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ - apk add -U darkhttpd && \ + apk add -U --no-cache darkhttpd su-exec && \ rm /usr/bin/qemu-arm-static -USER darkhttpd +COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ +COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets +COPY entrypoint.sh /entrypoint.sh + +HEALTHCHECK --interval=5s --timeout=5s --retries=3 \ + CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1 -ENTRYPOINT ["darkhttpd","/www/"] +EXPOSE ${PORT} +VOLUME /www/assets +ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]