]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - Dockerfile.arm32v7
Bump eventsource from 1.1.0 to 1.1.1
[github/bastienwirtz/homer.git] / Dockerfile.arm32v7
index 2113df58f2c7d7a0006601ed68a0666e0e1b7632..270d7b53be1918be87c2dc4728863f109f641c8d 100644 (file)
@@ -4,7 +4,7 @@ FROM node:lts-alpine as build-stage
 WORKDIR /app
 
 COPY package*.json ./
-RUN yarn install
+RUN yarn install --frozen-lockfile
 
 COPY . .
 RUN yarn build
@@ -17,20 +17,33 @@ 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
+FROM arm32v7/alpine:3.16
 
 COPY --from=qemu qemu-arm-static /usr/bin/
-COPY --from=build-stage /app/dist /www/
 
-ENV USER darkhttpd
-ENV GROUP darkhttpd
-ENV GID 911
-ENV UID 911
+ENV GID 1000
+ENV UID 1000
+ENV PORT 8080
+ENV SUBFOLDER "/_"
+ENV INIT_ASSETS 1
 
-RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
-    apk add -U darkhttpd && \
+RUN addgroup -S lighttpd -g ${GID} && adduser -D -S -u ${UID} lighttpd lighttpd && \
+    apk add -U --no-cache lighttpd && \
     rm /usr/bin/qemu-arm-static
 
-USER darkhttpd
+WORKDIR /www
 
-ENTRYPOINT ["darkhttpd","/www/","--no-listing"]
+COPY lighttpd.conf /lighttpd.conf
+COPY entrypoint.sh /entrypoint.sh
+COPY --from=build-stage --chown=${UID}:${GID} /app/dist /www/
+COPY --from=build-stage --chown=${UID}:${GID} /app/dist/assets /www/default-assets
+
+USER ${UID}:${GID}
+
+HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
+    CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1
+
+EXPOSE ${PORT}
+VOLUME /www/assets
+
+CMD ["lighttpd", "-D", "-f", "/lighttpd.conf"]