force the ENV
All checks were successful
Build and Push Docker Image / build (push) Successful in 47s

This commit is contained in:
2025-10-22 01:03:35 -07:00
parent 8fc3c0ae37
commit 4476c02354
3 changed files with 9 additions and 23 deletions

View File

@@ -19,9 +19,6 @@ RUN mkdir -p /usr/local/bin /config/log /config/web /etc/services.d/backupbot
COPY backup.sh /usr/local/bin/backup.sh COPY backup.sh /usr/local/bin/backup.sh
RUN chmod +x /usr/local/bin/backup.sh RUN chmod +x /usr/local/bin/backup.sh
# Copy the environment variables for the config
COPY backupbot.env /defaults/backupbot.env
# Copy s6 service for backupbot # Copy s6 service for backupbot
COPY services/backupbot/run /etc/services.d/backupbot/run COPY services/backupbot/run /etc/services.d/backupbot/run
RUN chmod +x /etc/services.d/backupbot/run RUN chmod +x /etc/services.d/backupbot/run
@@ -32,5 +29,14 @@ RUN chmod +x /defaults/web/backupbot.cgi
# Expose web frontend port # Expose web frontend port
EXPOSE 8080 EXPOSE 8080
ENV TZ=America/Los_Angeles
ENV BACKUP_DIR=/backups/postgres
ENV LOG_FILE=/config/log/pgbackup.log
ENV MAX_RETRIES=3
ENV GOTIFY_URL=http://gotify.example.com
ENV GOTIFY_TOKEN=your_gotify_token_here
ENV BACKUP_HOUR=03
ENV BACKUP_MINUTE=00
# Keep duplicati entrypoint # Keep duplicati entrypoint
ENTRYPOINT ["/init"] ENTRYPOINT ["/init"]

View File

@@ -1,8 +0,0 @@
TZ=America/Los_Angeles
BACKUP_DIR=/backups/postgres
LOG_FILE=/config/log/pgbackup.log
MAX_RETRIES=3
GOTIFY_URL=http://gotify.example.com
GOTIFY_TOKEN=your_gotify_token_here
BACKUP_HOUR=03
BACKUP_MINUTE=00

View File

@@ -1,17 +1,5 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
set -e set -e
# Source env if available
if [[ -f /config/backupbot.env ]]; then
set -a
source /config/backupbot.env
set +a
else
echo "[INFO] copying env vars from defaults..."
cp -r /defaults/backupbot.env /config/
set -a
source /config/backupbot.env
set +a
fi
# Initialize default web interface if missing # Initialize default web interface if missing
if [ ! -d /config/web ]; then if [ ! -d /config/web ]; then
echo "[INFO] Populating /config/web from defaults..." echo "[INFO] Populating /config/web from defaults..."