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