aether-hf / Dockerfile
iiioooo1's picture
chore: bump Aether upstream image sha256:60c4194c22c3
230cf3a verified
Raw
History Blame Contribute Delete
2.93 kB
# syntax=docker/dockerfile:1.7
# Aether on HF Space — wraps official ghcr.io/fawney19/aether image with a
# Debian shell layer that adds:
# - HF Hub backup/restore for the SQLite database
# - Cron-based periodic backup
# - Auto-update detection (rebuild Space when upstream digest changes)
ARG AETHER_IMAGE=ghcr.io/fawney19/aether@sha256:60c4194c22c3a7e6247fd9ec3663d11e29b9a71ab75d739cfae443e0e4ee055b
# --- aether stage: official distroless image with prebuilt binary + frontend ---
FROM ${AETHER_IMAGE} AS aether
# --- final stage: Debian slim runtime ---
FROM debian:12-slim
ENV DEBIAN_FRONTEND=noninteractive \
AETHER_BASE_DIR=/opt/aether \
AETHER_GATEWAY_STATIC_DIR=/opt/aether/current/frontend \
AETHER_DATABASE_DRIVER=sqlite \
AETHER_DATABASE_URL=sqlite:///opt/aether/data/aether.db \
AETHER_RUNTIME_BACKEND=memory \
AETHER_GATEWAY_DEPLOYMENT_TOPOLOGY=single-node \
AETHER_GATEWAY_NODE_ROLE=all \
AETHER_GATEWAY_AUTO_PREPARE_DATABASE=true \
AETHER_LOG_DESTINATION=stdout \
AETHER_LOG_FORMAT=pretty \
AETHER_UPDATE_STRATEGY=docker \
AETHER_DOCKER_UPDATE_COMMAND=/usr/local/bin/aether-auto-update.sh \
APP_PORT=7860 \
RUST_LOG=aether_gateway=info \
HOME=/root \
AETHER_BACKUP_REPO=iiioooo1/aether-hf-backup \
AETHER_BACKUP_DIR=/opt/aether/data \
AETHER_BACKUP_INTERVAL_MIN=30 \
AETHER_AUTO_UPDATE=true \
AETHER_AUTO_UPDATE_INTERVAL_HOURS=6
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl tar gzip cron python3 python3-pip jq tini \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir --break-system-packages "huggingface_hub>=0.24,<2"
# Bring Aether binary + frontend over.
COPY --from=aether /opt/aether /opt/aether
# HF runs as user 1000 by default unless we say otherwise. We stay root inside
# the container so cron + writes to /opt/aether work; HF allows this for Docker
# Spaces. The aether-gateway binary is statically linked.
RUN mkdir -p /opt/aether/data /opt/aether/logs /var/log/aether \
&& chmod -R 0777 /opt/aether/data /opt/aether/logs /var/log/aether
# Scripts
COPY scripts/aether-entrypoint.sh /usr/local/bin/aether-entrypoint.sh
COPY scripts/aether-backup.sh /usr/local/bin/aether-backup.sh
COPY scripts/aether-restore.sh /usr/local/bin/aether-restore.sh
COPY scripts/aether-auto-update.sh /usr/local/bin/aether-auto-update.sh
COPY scripts/aether_backup.py /usr/local/bin/aether_backup.py
COPY scripts/aether_restore.py /usr/local/bin/aether_restore.py
COPY scripts/aether_check_update.py /usr/local/bin/aether_check_update.py
RUN chmod 0755 /usr/local/bin/aether-entrypoint.sh \
/usr/local/bin/aether-backup.sh \
/usr/local/bin/aether-restore.sh \
/usr/local/bin/aether-auto-update.sh
EXPOSE 7860
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/aether-entrypoint.sh"]