Download Dockerfile from zyxciss/test71: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/spaces/zyxciss/test71/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/zyxciss/test71/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/zyxciss/test71/resolve/main/Dockerfile
1.24 kB
| # Use a lightweight Python image | |
| FROM python:3.10-slim | |
| # Install dependencies | |
| RUN apt-get update && apt-get install -y git sqlite3 && rm -rf /var/lib/apt/lists/* | |
| # Create a non-root user | |
| RUN useradd -m searxng | |
| USER searxng | |
| WORKDIR /home/searxng | |
| # Clone SearXNG repository | |
| RUN git clone --depth=1 https://github.com/searxng/searxng.git | |
| # Install SearXNG dependencies | |
| WORKDIR /home/searxng/searxng | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Ensure the settings and config directories exist | |
| RUN mkdir -p /home/searxng/searxng/searx /home/searxng/searxng/config | |
| # Generate a secure secret key and save it to settings.yml | |
| RUN python3 -c 'import secrets, os; os.makedirs("/home/searxng/searxng/searx", exist_ok=True); open("/home/searxng/searxng/searx/settings.yml", "w").write(f"server:\n secret_key: \"{secrets.token_hex(32)}\"\n")' | |
| # Fix: Create an empty limiter.toml inside /home/searxng/searxng/config | |
| RUN touch /home/searxng/searxng/config/limiter.toml | |
| # Fix: Set environment variables | |
| ENV PYTHONWARNINGS=ignore SQLITE_BUSY_TIMEOUT=5000 SEARXNG_SETTINGS_PATH=/home/searxng/searxng/config/ | |
| # Expose port 7860 (required for Hugging Face) | |
| EXPOSE 7860 | |
| # Start SearXNG | |
| CMD ["python", "-m", "searx.webapp", "--port", "7860"] |