From 84c02f6b48608a99f9bf4ce1e94a7e19a4fa56a4 Mon Sep 17 00:00:00 2001 From: Felipe Cotti Date: Mon, 27 Jan 2025 01:54:40 -0300 Subject: [PATCH] Chmod, please. Also, fix environment variables. Hopefully. --- build/.env.template | 3 ++- build/docker-compose.public.yml | 4 ++-- build/guestbooky-backup/Dockerfile | 4 +--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/build/.env.template b/build/.env.template index 1b10862..c15cdcb 100644 --- a/build/.env.template +++ b/build/.env.template @@ -15,4 +15,5 @@ BACKUP_S3_KEY_NAME=guestbooky-backup BACKUP_S3_ACCESS_ID=0000000000000000000000000 BACKUP_S3_SECRET_ID=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BACKUP_S3_ENDPOINT=https://s3.us-east-005.backblazeb2.com -BACKUP_S3_REGION=us-east-005 \ No newline at end of file +BACKUP_S3_REGION=us-east-005 +BACKUP_SOURCE_PATH=/backups/guestbooky_$(date +\%Y-\%m-\%d) \ No newline at end of file diff --git a/build/docker-compose.public.yml b/build/docker-compose.public.yml index d8d614b..20b6339 100644 --- a/build/docker-compose.public.yml +++ b/build/docker-compose.public.yml @@ -66,7 +66,7 @@ services: --username ${GUESTBOOKY_USER} --password ${GUESTBOOKY_USER} --authenticationDatabase ${GUESTBOOKY_DB_NAME} - --out /backups/guestbooky_$(date +\%Y-\%m-\%d) && touch /backups/backup_done" + --out ${BACKUP_SOURCE_PATH} && touch /backups/backup_done" volumes: - ./backups:/backups depends_on: @@ -89,7 +89,7 @@ services: BACKUP_S3_ENDPOINT: ${BACKUP_S3_ENDPOINT} BACKUP_S3_REGION: ${BACKUP_S3_REGION} BACKUP_SOURCE_PATH: ${BACKUP_SOURCE_PATH} - BACKUP_DESTINATION_PATH: ${BACKUP_DESTINATION_PATH}.gzip + BACKUP_DESTINATION_PATH: ${BACKUP_SOURCE_PATH}.gzip volumes: - ./backups:/backups diff --git a/build/guestbooky-backup/Dockerfile b/build/guestbooky-backup/Dockerfile index f59cd8d..b77fa7d 100644 --- a/build/guestbooky-backup/Dockerfile +++ b/build/guestbooky-backup/Dockerfile @@ -9,13 +9,11 @@ RUN go mod download RUN go build -o guestbooky-backup cmd/guestbooky-backup/guestbooky-backup.go -# Start a new stage from scratch FROM alpine:latest WORKDIR /root/ -# Copy the Pre-built binary file from the previous stage COPY --from=builder /app/guestbooky-backup . +RUN chmod +x guestbooky-backup -# Command to run the executable CMD ["./guestbooky-backup"] \ No newline at end of file