X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=inline;f=Dockerfile.arm32v7;h=2256d2a6efa27aa683b3d5e827d099e12ebc3833;hb=b6b31e440c7915e82fe8b9a4b93083ec9fb2e9fd;hp=e78d37c8f61f561821c6359ee48ccf7c29fad171;hpb=525120de61ec27c8d64207a703061c9400f77c07;p=github%2Fbastienwirtz%2Fhomer.git diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 index e78d37c..2256d2a 100644 --- a/Dockerfile.arm32v7 +++ b/Dockerfile.arm32v7 @@ -1,22 +1,44 @@ -FROM alpine AS builder +# build stage +FROM node:lts-alpine as build-stage -# Download QEMU, see https://github.com/docker/hub-feedback/issues/1261 -ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-aarch64.tar.gz -RUN apk add curl && curl -L ${QEMU_URL} | tar zxvf - -C . --strip-components 1 +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=builder qemu-aarch64-static /usr/bin -COPY ./ /www/ +COPY --from=qemu qemu-arm-static /usr/bin/ -ENV USER darkhttpd -ENV GROUP darkhttpd +ENV USER lighttpd +ENV GROUP lighttpd 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 lighttpd && \ + rm /usr/bin/qemu-arm-static + +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 +COPY lighttpd.conf /lighttpd.conf -USER darkhttpd +HEALTHCHECK --interval=30s --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"]