ci(deploy): fix permissions for data

This commit is contained in:
Tine 2024-02-18 11:16:00 +01:00
parent 2cb4042a20
commit dc3251d00f
Signed by: mentos1386
SSH key fingerprint: SHA256:MNtTsLbihYaWF8j1fkOHfkKNlnN1JQfxEU/rBU8nCGw

View file

@ -14,6 +14,9 @@ COPY . ./
# Build # Build
RUN CGO_ENABLED=1 GOOS=linux go build -o /bin/zdravko cmd/zdravko/main.go 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 # Final production
FROM gcr.io/distroless/base-debian12:nonroot as production FROM gcr.io/distroless/base-debian12:nonroot as production
@ -31,7 +34,7 @@ EXPOSE 7233
# Volume to persist sqlite databases # Volume to persist sqlite databases
VOLUME /data 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 DATABASE_PATH=/data/zdravko.db
ENV TEMPORAL_DATABASE_PATH=/data/temporal.db ENV TEMPORAL_DATABASE_PATH=/data/temporal.db