FROM alpine:3.20

RUN apk add --no-cache \
      postgresql16-client \
      aws-cli \
      gzip \
      tzdata \
      bash \
      coreutils

# Default TZ for timestamps and schedule interpretation. Override via compose env.
ENV TZ=Africa/Nairobi

WORKDIR /app
COPY backup_db.sh /app/backup_db.sh
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/backup_db.sh /app/entrypoint.sh

ENTRYPOINT ["/app/entrypoint.sh"]
