Update Dockerfile
Browse files- Dockerfile +9 -2
Dockerfile
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
|
|
| 1 |
FROM python:3.10
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
COPY requirements.txt .
|
| 6 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 7 |
|
| 8 |
-
|
|
|
|
| 9 |
|
|
|
|
| 10 |
EXPOSE 7860
|
| 11 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python 3.10 base image
|
| 2 |
FROM python:3.10
|
| 3 |
|
| 4 |
+
# Set working directory to /app
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy requirements.txt and install dependencies
|
| 8 |
COPY requirements.txt .
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
+
# Copy only main.py (no need for utils.py)
|
| 12 |
+
COPY ./app/main.py ./app/main.py
|
| 13 |
|
| 14 |
+
# Expose port 7860 for FastAPI/Gradio
|
| 15 |
EXPOSE 7860
|
| 16 |
+
|
| 17 |
+
# Run the FastAPI app with uvicorn
|
| 18 |
+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|