Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

Attempt #182391239123

Katos6ad0c33340ec
diff --git a/Dockerfile.rootless b/Dockerfile.rootless
index 23d68556..ec0dafa7 100644
--- a/Dockerfile.rootless
+++ b/Dockerfile.rootless
@@ -72,6 +72,9 @@ RUN mkdir /app
COPY --from=builder /go/bin/api /app
RUN chmod +x /app/api
+# Create /data directory and set ownership for required directories
+RUN mkdir /data && chown -R nonroot:nonroot /app /app/api /data
+
# Labels and configuration for the final image
LABEL Name=homebox Version=0.0.1
LABEL org.opencontainers.image.source="https://github.com/sysadminsmedia/homebox"
@@ -87,9 +90,6 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
# Persist volume
VOLUME [ "/data" ]
-# Set ownership for required directories
-RUN chown -R nonroot:nonroot /app /app/api /data
-
# Entrypoint and CMD
USER nonroot
ENTRYPOINT [ "/app/api" ]