mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-03 08:10:28 +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 \
|
||||
-v ./app/api/*.go && \
|
||||
chmod +x /go/bin/api && \
|
||||
# create a directory so that we can copy it in the next stage
|
||||
mkdir /data
|
||||
|
||||
# Production Stage
|
||||
|
@ -36,6 +37,8 @@ ENV HBOX_MODE=production
|
|||
ENV HBOX_STORAGE_DATA=/data/
|
||||
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 /data /data
|
||||
|
||||
|
@ -45,6 +48,7 @@ EXPOSE 7745
|
|||
WORKDIR /app
|
||||
VOLUME [ "/data" ]
|
||||
|
||||
# Drop root and run as low-privileged user
|
||||
USER nonroot
|
||||
ENTRYPOINT [ "/app/api" ]
|
||||
CMD [ "/data/config.yml" ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue