Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +13 -6
Dockerfile
CHANGED
|
@@ -1,12 +1,19 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
|
|
|
| 7 |
|
| 8 |
-
|
|
|
|
| 9 |
|
|
|
|
| 10 |
EXPOSE 8000
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
| 1 |
+
# Use the official Ollama image as the base
|
| 2 |
+
FROM ollama/ollama
|
| 3 |
|
| 4 |
+
# Install Python and dependencies for the custom API
|
| 5 |
+
RUN apt-get update && apt-get install -y python3 python3-pip
|
| 6 |
+
RUN pip3 install fastapi uvicorn requests
|
| 7 |
|
| 8 |
+
# Copy a script to pull the model at container startup
|
| 9 |
+
COPY entrypoint.sh /entrypoint.sh
|
| 10 |
+
RUN chmod +x /entrypoint.sh
|
| 11 |
|
| 12 |
+
# Copy the FastAPI app
|
| 13 |
+
COPY app.py /app.py
|
| 14 |
|
| 15 |
+
# Expose the port for the FastAPI server
|
| 16 |
EXPOSE 8000
|
| 17 |
|
| 18 |
+
# Run the entrypoint script and start the FastAPI server
|
| 19 |
+
CMD ["/entrypoint.sh"]
|