Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -7
Dockerfile
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
# Use official Python slim image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
|
@@ -7,18 +8,18 @@ ENV PYTHONUNBUFFERED=1
|
|
| 7 |
# Set working directory
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
-
#
|
| 11 |
COPY requirements.txt .
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
-
# Copy
|
| 15 |
-
COPY .env .
|
| 16 |
-
COPY main.py .
|
| 17 |
-
# If you have other modules or folders, copy them too:
|
| 18 |
COPY . .
|
| 19 |
|
| 20 |
-
# Expose
|
| 21 |
EXPOSE 7860
|
| 22 |
|
| 23 |
-
#
|
|
|
|
| 24 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
| 1 |
+
```dockerfile
|
| 2 |
# Use official Python slim image
|
| 3 |
FROM python:3.11-slim
|
| 4 |
|
|
|
|
| 8 |
# Set working directory
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
+
# Install dependencies
|
| 12 |
COPY requirements.txt .
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
+
# Copy application code
|
|
|
|
|
|
|
|
|
|
| 16 |
COPY . .
|
| 17 |
|
| 18 |
+
# Expose FastAPI port
|
| 19 |
EXPOSE 7860
|
| 20 |
|
| 21 |
+
# Start the app with Uvicorn
|
| 22 |
+
# Ensure GROQ_API_KEY is provided as an environment variable at runtime
|
| 23 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 24 |
+
```
|
| 25 |
+
|