Use soundcloak user for Docker image; update ignore files

This commit is contained in:
vlnst
2024-11-26 22:37:40 +03:00
parent 3ea616237d
commit ba4e674dc6
3 changed files with 10 additions and 2 deletions

View File

@@ -9,7 +9,9 @@ WORKDIR /build
COPY . .
RUN go install github.com/a-h/templ/cmd/templ@latest && \
templ generate && \
CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=${TARGETOS} go build -ldflags "-s -w -extldflags '-static'" -o ./app
CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=${TARGETOS} go build -ldflags "-s -w -extldflags '-static'" -o ./app && \
echo "soundcloak:x:5000:5000:Soundcloak user:/:/sbin/nologin" > /etc/minimal-passwd && \
echo "soundcloak:x:5000:" > /etc/minimal-group
FROM node:${NODE_VERSION} AS node
WORKDIR /hls.js
@@ -22,7 +24,11 @@ COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /build/assets /assets
COPY --from=build /build/app /app
COPY --from=node /hls.js/node_modules/hls.js/dist/hls.light.min.js /node_modules/hls.js/dist/hls.light.min.js
COPY --from=build /etc/minimal-passwd /etc/passwd
COPY --from=build /etc/minimal-group /etc/group
EXPOSE 4664
USER soundcloak
ENTRYPOINT ["/app"]