Spaces:
Sleeping
Sleeping
updated dockerfile
Browse files- Dockerfile +6 -12
Dockerfile
CHANGED
|
@@ -1,21 +1,15 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
|
| 6 |
-
|
| 7 |
-
WORKDIR /app
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
RUN pip install --no-cache-dir --upgrade pip \
|
| 12 |
-
&& if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; else pip install --no-cache-dir transformers torch; fi
|
| 13 |
|
| 14 |
-
# Copy the rest of the code
|
| 15 |
COPY . .
|
| 16 |
|
| 17 |
-
# Expose port (change if your app uses a different port)
|
| 18 |
EXPOSE 7860
|
| 19 |
|
| 20 |
-
|
| 21 |
-
CMD ["python", "app.py"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 4 |
+
PORT=7860
|
| 5 |
|
| 6 |
+
WORKDIR /code
|
|
|
|
| 7 |
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
| 10 |
|
|
|
|
| 11 |
COPY . .
|
| 12 |
|
|
|
|
| 13 |
EXPOSE 7860
|
| 14 |
|
| 15 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|