]>
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 ./ | |
7 | RUN yarn install | |
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-aarch64-static && chmod +x qemu-aarch64-static | |
18 | ||
b9c5fcf0 | 19 | # production stage |
abe6df52 AZ |
20 | FROM arm64v8/alpine:3.11 |
21 | ||
5a5412c5 | 22 | COPY --from=qemu qemu-aarch64-static /usr/bin/ |
b9c5fcf0 | 23 | COPY --from=build-stage /app/dist /www/ |
abe6df52 AZ |
24 | |
25 | ENV USER darkhttpd | |
26 | ENV GROUP darkhttpd | |
27 | ENV GID 911 | |
28 | ENV UID 911 | |
29 | ||
30 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ | |
5a5412c5 AZ |
31 | apk add -U darkhttpd && \ |
32 | rm /usr/bin/qemu-aarch64-static | |
abe6df52 AZ |
33 | |
34 | USER darkhttpd | |
35 | ||
0d6a177b | 36 | ENTRYPOINT ["darkhttpd","/www/","--no-listing"] |