Spaces:
Sleeping
Sleeping
Download Dockerfile from sandy898/resonate-api: direct link, hf CLI and curl.
- Browser
- Download file 863 Bytes
-
https://huggingface.co/spaces/sandy898/resonate-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/sandy898/resonate-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/sandy898/resonate-api/resolve/main/Dockerfile
863 Bytes
| FROM python:3.11.6-slim-bookworm | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| PORT=7860 \ | |
| DATA_DIR=/app/data | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git \ | |
| curl \ | |
| postgresql-client \ | |
| postgresql \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Add postgres binaries to path so user can run initdb/pg_ctl | |
| ENV PATH="/usr/lib/postgresql/15/bin:$PATH" | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY app ./app | |
| COPY data ./data | |
| COPY run.sh . | |
| RUN chmod +x run.sh | |
| # Ensure user owns /app and everything in it | |
| RUN chown -R user:user /app | |
| # Ensure user has access to /var/run/postgresql for sockets | |
| RUN mkdir -p /var/run/postgresql && chown -R user:user /var/run/postgresql | |
| USER user | |
| EXPOSE 7860 | |
| CMD ["./run.sh"] |