Update Dockerfile
Browse files- Dockerfile +19 -1
Dockerfile
CHANGED
|
@@ -1,5 +1,23 @@
|
|
| 1 |
FROM python:3.10-slim
|
|
|
|
|
|
|
| 2 |
WORKDIR /app
|
|
|
|
|
|
|
| 3 |
COPY . /app
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
CMD ["python", "api.py"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
# Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
+
|
| 6 |
+
# Copy project files
|
| 7 |
COPY . /app
|
| 8 |
+
|
| 9 |
+
# Upgrade pip first
|
| 10 |
+
RUN pip install --no-cache-dir --upgrade pip
|
| 11 |
+
|
| 12 |
+
# 🩵 Force reinstall the correct OpenAI SDK and install dependencies
|
| 13 |
+
RUN pip uninstall -y openai || true
|
| 14 |
+
RUN pip install --no-cache-dir openai==1.12.0
|
| 15 |
+
|
| 16 |
+
# Install the rest of the dependencies
|
| 17 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
+
|
| 19 |
+
# Expose the port (optional but useful for hosting)
|
| 20 |
+
EXPOSE 7860
|
| 21 |
+
|
| 22 |
+
# Start the Flask API
|
| 23 |
CMD ["python", "api.py"]
|