Download Dockerfile from kipeles/apexkit: direct link, hf CLI and curl.
- Browser
- Download file 1.78 kB
-
https://huggingface.co/spaces/kipeles/apexkit/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/kipeles/apexkit/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/kipeles/apexkit/resolve/main/Dockerfile
1.78 kB
| FROM ubuntu:24.04 | |
| # Disable interactive prompts during package installation | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # 1. Install dependencies (added procps for pgrep/pkill supervision) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| curl \ | |
| jq \ | |
| msmtp \ | |
| msmtp-mta \ | |
| ca-certificates \ | |
| tar \ | |
| rsync \ | |
| bash \ | |
| procps \ | |
| python3 \ | |
| python3-pip \ | |
| python3-venv \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 2. Setup non-root user (UID 1000) | |
| RUN userdel -r ubuntu && useradd -m -u 1000 user | |
| WORKDIR /app | |
| # 3. Setup Python Virtual Environment and PATH | |
| RUN python3 -m venv /app/venv | |
| ENV PATH="/app/bin:/app/venv/bin:$PATH" | |
| RUN pip install --no-cache-dir fastapi uvicorn requests pydantic | |
| # 4. Download & Install ApexKit Binary into /app/bin (User-writable) | |
| RUN echo "Downloading latest public release archive..." && \ | |
| LATEST_URL=$(curl -s https://api.github.com/repos/deniskipeles/apexkit/releases/latest | \ | |
| jq -r '.assets[] | select(.name | contains("linux-gnu.tar.gz")) | .browser_download_url') && \ | |
| echo "URL: $LATEST_URL" && \ | |
| curl -L -o apexkit.tar.gz "$LATEST_URL" && \ | |
| tar -xzf apexkit.tar.gz && \ | |
| mkdir -p /app/bin && \ | |
| mv apexkit /app/bin/apexkit && \ | |
| chmod +x /app/bin/apexkit && \ | |
| ln -sf /app/bin/apexkit /usr/local/bin/apexkit && \ | |
| rm apexkit.tar.gz | |
| # 5. Copy FastAPI Application | |
| COPY --chown=user:user main.py /app/main.py | |
| # 6. Setup storage directories & ensure full ownership by user | |
| RUN mkdir -p /app/bin /app/storage /data/storage /data/bin && \ | |
| chown -R user:user /app /data | |
| # 7. Copy and prepare entrypoint script | |
| COPY --chown=user:user entrypoint.sh /app/entrypoint.sh | |
| RUN chmod +x /app/entrypoint.sh | |
| USER user | |
| ENV PORT=7860 | |
| ENTRYPOINT ["/app/entrypoint.sh"] |