]> git.immae.eu Git - github/bastienwirtz/homer.git/blob - Dockerfile.arm64v8
Added ENV PORT options and EXPORT PORT
[github/bastienwirtz/homer.git] / Dockerfile.arm64v8
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-aarch64-static && chmod +x qemu-aarch64-static
18
19 # production stage
20 FROM arm64v8/alpine:3.11
21
22 COPY --from=qemu qemu-aarch64-static /usr/bin/
23
24 ENV USER darkhttpd
25 ENV GROUP darkhttpd
26 ENV GID 911
27 ENV UID 911
28 ENV PORT 8080
29
30 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
31 apk add -U darkhttpd && \
32 rm /usr/bin/qemu-aarch64-static
33
34 RUN echo "darkhttpd /www/ --no-listing --port $PORT" > /entrypoint.sh
35 RUN set -ex chown ${USER}:${GROUP} /entrypoint.sh
36
37 USER ${USER}
38
39 COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
40
41 EXPOSE ${PORT}
42 ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]