FROM gotify/server:latest USER root RUN apt-get update && apt-get install -y git openssl && rm -rf /var/lib/apt/lists/* # Create writable dirs RUN mkdir -p /home/user/gotify/images \ /home/user/gotify/plugins \ /home/user/gotify/data \ /home/user/entrypoint && \ chown -R 1000:1000 /home/user # Copy scripts COPY entrypoint.sh /home/user/entrypoint/entrypoint.sh COPY backup.sh /home/user/entrypoint/backup.sh COPY restore.sh /home/user/entrypoint/restore.sh RUN chmod +x /home/user/entrypoint/*.sh # Switch to HF default user USER 1000 # HF Spaces provides $PORT (default 7860) ENV GOTIFY_SERVER_PORT=${PORT:-7860} # SQLite database path (pointed inside /home/user/gotify) WORKDIR /home/user/gotify ENV GOTIFY_SERVER_KEEPALIVEDIR=/home/user/gotify/data ENV GOTIFY_DATABASE_PATH=/home/user/gotify/data/gotify.db # Backup/restore config ENV BACKUP_FILE=gotify-db.enc ENV BACKUP_INTERVAL=300 EXPOSE 7860 ENTRYPOINT ["/home/user/entrypoint/entrypoint.sh"]