From dc3251d00f7472cd4178d380a022c0a1061b162b Mon Sep 17 00:00:00 2001 From: Tine Date: Sun, 18 Feb 2024 11:16:00 +0100 Subject: [PATCH] ci(deploy): fix permissions for data --- build/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/Dockerfile b/build/Dockerfile index 8e7942d..c159f66 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -14,6 +14,9 @@ COPY . ./ # Build RUN CGO_ENABLED=1 GOOS=linux go build -o /bin/zdravko cmd/zdravko/main.go +# Prepare the data directory +RUN mkdir -p /data + ### # Final production FROM gcr.io/distroless/base-debian12:nonroot as production @@ -31,7 +34,7 @@ EXPOSE 7233 # Volume to persist sqlite databases VOLUME /data -RUN mkdir -p /data && chown -R nonroot:nonroot /data +COPY --from=builder --chown=nonroot:nonroot /data /data ENV DATABASE_PATH=/data/zdravko.db ENV TEMPORAL_DATABASE_PATH=/data/temporal.db