mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-05 09:10:26 +00:00
chore: Commen the Dockerfile
This commit is contained in:
parent
1c870d80f9
commit
f1d2fb5bdf
1 changed files with 4 additions and 0 deletions
|
@ -27,6 +27,7 @@ RUN CGO_ENABLED=0 GOOS=linux go build \
|
||||||
-o /go/bin/api \
|
-o /go/bin/api \
|
||||||
-v ./app/api/*.go && \
|
-v ./app/api/*.go && \
|
||||||
chmod +x /go/bin/api && \
|
chmod +x /go/bin/api && \
|
||||||
|
# create a directory so that we can copy it in the next stage
|
||||||
mkdir /data
|
mkdir /data
|
||||||
|
|
||||||
# Production Stage
|
# Production Stage
|
||||||
|
@ -36,6 +37,8 @@ ENV HBOX_MODE=production
|
||||||
ENV HBOX_STORAGE_DATA=/data/
|
ENV HBOX_STORAGE_DATA=/data/
|
||||||
ENV HBOX_STORAGE_SQLITE_URL=/data/homebox.db?_fk=1
|
ENV HBOX_STORAGE_SQLITE_URL=/data/homebox.db?_fk=1
|
||||||
|
|
||||||
|
# Copy the binary and the (empty) /data dir and
|
||||||
|
# change the ownership to the low-privileged user
|
||||||
COPY --from=builder --chown=nonroot /go/bin/api /app/api
|
COPY --from=builder --chown=nonroot /go/bin/api /app/api
|
||||||
COPY --from=builder --chown=nonroot /data /data
|
COPY --from=builder --chown=nonroot /data /data
|
||||||
|
|
||||||
|
@ -45,6 +48,7 @@ EXPOSE 7745
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
VOLUME [ "/data" ]
|
VOLUME [ "/data" ]
|
||||||
|
|
||||||
|
# Drop root and run as low-privileged user
|
||||||
USER nonroot
|
USER nonroot
|
||||||
ENTRYPOINT [ "/app/api" ]
|
ENTRYPOINT [ "/app/api" ]
|
||||||
CMD [ "/data/config.yml" ]
|
CMD [ "/data/config.yml" ]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue