diff --git a/Dockerfile b/Dockerfile index d25a8ac..ee958ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,14 @@ FROM alpine WORKDIR /app # Copy built binary from build image -COPY --from=build /workspace/grafana-backuper /app +COPY --from=build /workspace/grafana-backuper . -ENTRYPOINT ["/app/grafana-backuper backup --json"] +RUN chmod +x grafana-backuper + +# Copy the wrapper script +COPY entrypoint.sh . + +# Ensure the script is executable +RUN chmod +x entrypoint.sh + +ENTRYPOINT ["entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..9a7bc3e --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Check if the environment variable GRAFANA_MODE is set +if [ -z "$GB_SEQUENCE" ]; then + exec /app/grafana-backuper backup --json +else + exec /app/grafana-backuper --json +fi