Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +8 -5
Dockerfile
CHANGED
|
@@ -8,9 +8,9 @@ RUN pip3 install fastapi uvicorn requests
|
|
| 8 |
# Create a directory for persistent storage (Hugging Face Spaces uses /data)
|
| 9 |
RUN mkdir -p /data/.ollama && ln -s /data/.ollama /root/.ollama
|
| 10 |
|
| 11 |
-
# Copy the
|
| 12 |
-
COPY
|
| 13 |
-
RUN chmod +x /
|
| 14 |
|
| 15 |
# Copy the FastAPI app
|
| 16 |
COPY app.py /app.py
|
|
@@ -18,5 +18,8 @@ COPY app.py /app.py
|
|
| 18 |
# Expose the port for the FastAPI server (Hugging Face Spaces uses 8000)
|
| 19 |
EXPOSE 8000
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
CMD ["
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
# Create a directory for persistent storage (Hugging Face Spaces uses /data)
|
| 9 |
RUN mkdir -p /data/.ollama && ln -s /data/.ollama /root/.ollama
|
| 10 |
|
| 11 |
+
# Copy the startup script for model pulling and FastAPI
|
| 12 |
+
COPY startup.sh /startup.sh
|
| 13 |
+
RUN chmod +x /startup.sh
|
| 14 |
|
| 15 |
# Copy the FastAPI app
|
| 16 |
COPY app.py /app.py
|
|
|
|
| 18 |
# Expose the port for the FastAPI server (Hugging Face Spaces uses 8000)
|
| 19 |
EXPOSE 8000
|
| 20 |
|
| 21 |
+
# Run ollama serve as the main command
|
| 22 |
+
CMD ["serve"]
|
| 23 |
+
|
| 24 |
+
# Start the startup script in the background during container initialization
|
| 25 |
+
RUN echo "/startup.sh &" >> /etc/profile.d/startup.sh
|