File size: 714 Bytes
e509f4e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # HF Spaces Dockerfile - 1proxy Backend
# Completely rewritten for HF Spaces deployment
FROM python:3.12-slim
WORKDIR /app
# Install dependencies first (better caching)
# When deployed, the hf-spaces folder IS the root, so requirements.txt is at ./requirements.txt
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
# Copy application code
# When deployed, 1proxy-backend is copied alongside other files, not as subdirectory
COPY . /app/
# Create data directory
RUN mkdir -p /app/data && chmod 777 /app/data
EXPOSE 7860
ENV PYTHONPATH=/app
ENV PORT=7860
ENV HOST=0.0.0.0
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|