-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (28 loc) · 885 Bytes
/
Dockerfile
File metadata and controls
32 lines (28 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM node:20-alpine AS builder
WORKDIR /build
ARG version
ARG TARGETARCH
RUN apk add --update build-base git jq zip
RUN git clone https://github.com/rejetto/hfs; \
cd hfs; \
git checkout "$version"; \
npm i; \
npm audit fix; \
npm i && npm run build-server && npm run build-frontend && npm run build-admin; \
npm run dist-pre; \
cd dist; \
crc="$TARGETARCH"; \
if [[ "$TARGETARCH" == "amd64" ]]; then crc="x64"; fi; \
npm i -f --no-save --omit=dev @node-rs/crc32-linux-$crc-gnu; \
npx pkg . --public -C gzip -t node20-alpine-$crc
FROM alpine:3.20
WORKDIR /app
RUN apk add --update zip libstdc++ ffmpeg
RUN adduser -h /home/hfs -D hfs hfs && \
mkdir /home/hfs/.hfs && \
cd /home/hfs/.hfs && \
touch config.yaml && \
chown -R hfs /home/hfs/.hfs
USER hfs
COPY --from=builder /build/hfs/dist/hfs hfs
ENTRYPOINT [ "/app/hfs" ]