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