]> git.immae.eu Git - github/bastienwirtz/homer.git/blame - Dockerfile.arm64v8
Merge pull request #385 from saschabrockel/patch-1
[github/bastienwirtz/homer.git] / Dockerfile.arm64v8
CommitLineData
b9c5fcf0
BW
1# build stage
2FROM node:lts-alpine as build-stage
3
4WORKDIR /app
5
6COPY package*.json ./
e6596ca6 7RUN yarn install --frozen-lockfile
b9c5fcf0
BW
8
9COPY . .
10RUN yarn build
11
12# Multi arch build support
5a5412c5
AZ
13FROM alpine as qemu
14
514b68ea 15ARG QEMU_VERSION="v4.2.0-7"
5a5412c5
AZ
16
17RUN wget https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_VERSION}/qemu-aarch64-static && chmod +x qemu-aarch64-static
18
b9c5fcf0 19# production stage
abe6df52
AZ
20FROM arm64v8/alpine:3.11
21
5a5412c5 22COPY --from=qemu qemu-aarch64-static /usr/bin/
abe6df52
AZ
23
24ENV USER darkhttpd
25ENV GROUP darkhttpd
26ENV GID 911
27ENV UID 911
481ab9a0 28ENV PORT 8080
abe6df52
AZ
29
30RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
d05b8d3b 31 apk add -U --no-cache darkhttpd su-exec && \
5a5412c5 32 rm /usr/bin/qemu-aarch64-static
abe6df52 33
d10b219d 34COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
b102c9b2 35COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets
fd9237eb 36COPY entrypoint.sh /entrypoint.sh
d10b219d 37
220c60cb 38HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
6dd8342b
DV
39 CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1
40
481ab9a0 41EXPOSE ${PORT}
b102c9b2 42VOLUME /www/assets
481ab9a0 43ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]