]>
Commit | Line | Data |
---|---|---|
b9c5fcf0 BW |
1 | # build stage |
2 | FROM node:lts-alpine as build-stage | |
3 | ||
4 | WORKDIR /app | |
5 | ||
6 | COPY package*.json ./ | |
e6596ca6 | 7 | RUN yarn install --frozen-lockfile |
b9c5fcf0 BW |
8 | |
9 | COPY . . | |
10 | RUN yarn build | |
11 | ||
12 | # Multi arch build support | |
5a5412c5 AZ |
13 | FROM alpine as qemu |
14 | ||
514b68ea | 15 | ARG QEMU_VERSION="v4.2.0-7" |
5a5412c5 AZ |
16 | |
17 | RUN wget https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_VERSION}/qemu-arm-static && chmod +x qemu-arm-static | |
18 | ||
b9c5fcf0 | 19 | # production stage |
abe6df52 AZ |
20 | FROM arm32v7/alpine:3.11 |
21 | ||
5a5412c5 | 22 | COPY --from=qemu qemu-arm-static /usr/bin/ |
abe6df52 AZ |
23 | |
24 | ENV USER darkhttpd | |
25 | ENV GROUP darkhttpd | |
26 | ENV GID 911 | |
27 | ENV UID 911 | |
481ab9a0 | 28 | ENV PORT 8080 |
abe6df52 AZ |
29 | |
30 | RUN 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-arm-static |
abe6df52 | 33 | |
d10b219d | 34 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ |
b102c9b2 | 35 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets |
fd9237eb | 36 | COPY entrypoint.sh /entrypoint.sh |
d10b219d | 37 | |
220c60cb | 38 | HEALTHCHECK --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 | 41 | EXPOSE ${PORT} |
b102c9b2 | 42 | VOLUME /www/assets |
481ab9a0 | 43 | ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] |