]> git.immae.eu Git - github/bastienwirtz/homer.git/blob - Dockerfile.arm32v7
Merge pull request #448 from bemble/main
[github/bastienwirtz/homer.git] / Dockerfile.arm32v7
1 # build stage
2 FROM node:lts-alpine as build-stage
3
4 WORKDIR /app
5
6 COPY package*.json ./
7 RUN yarn install --frozen-lockfile
8
9 COPY . .
10 RUN yarn build
11
12 # Multi arch build support
13 FROM alpine as qemu
14
15 ARG QEMU_VERSION="v4.2.0-7"
16
17 RUN wget https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_VERSION}/qemu-arm-static && chmod +x qemu-arm-static
18
19 # production stage
20 FROM arm32v7/alpine:3.16
21
22 COPY --from=qemu qemu-arm-static /usr/bin/
23
24 ENV GID 1000
25 ENV UID 1000
26 ENV PORT 8080
27 ENV SUBFOLDER "/_"
28 ENV INIT_ASSETS 1
29
30 RUN addgroup -S lighttpd -g ${GID} && adduser -D -S -u ${UID} lighttpd lighttpd && \
31 apk add -U --no-cache lighttpd && \
32 rm /usr/bin/qemu-arm-static
33
34 WORKDIR /www
35
36 COPY lighttpd.conf /lighttpd.conf
37 COPY entrypoint.sh /entrypoint.sh
38 COPY --from=build-stage --chown=${UID}:${GID} /app/dist /www/
39 COPY --from=build-stage --chown=${UID}:${GID} /app/dist/assets /www/default-assets
40
41 USER ${UID}:${GID}
42
43 HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
44 CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1
45
46 EXPOSE ${PORT}
47 VOLUME /www/assets
48
49 CMD ["lighttpd", "-D", "-f", "/lighttpd.conf"]