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