Update Dockerfile
Browse files- Dockerfile +8 -14
Dockerfile
CHANGED
|
@@ -1,19 +1,13 @@
|
|
| 1 |
-
# Use the official Ollama image
|
| 2 |
-
FROM alpine/ollama
|
| 3 |
|
| 4 |
-
# Set
|
| 5 |
ENV OLLAMA_HOST=0.0.0.0:7860
|
|
|
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
#RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
| 9 |
-
|
| 10 |
-
# Expose the default Hugging Face Space port
|
| 11 |
EXPOSE 7860
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
RUN chmod +x start.sh
|
| 17 |
-
|
| 18 |
-
# Run the startup script
|
| 19 |
-
ENTRYPOINT ["/bin/sh","/start.sh"]
|
|
|
|
| 1 |
+
# Use the official minimal Alpine Ollama image [2]
|
| 2 |
+
FROM alpine/ollama:latest
|
| 3 |
|
| 4 |
+
# Set environment variables for Ollama
|
| 5 |
ENV OLLAMA_HOST=0.0.0.0:7860
|
| 6 |
+
ENV OLLAMA_MODELS=/root/.ollama/models
|
| 7 |
|
| 8 |
+
# Expose the default Ollama port [15]
|
|
|
|
|
|
|
|
|
|
| 9 |
EXPOSE 7860
|
| 10 |
|
| 11 |
+
# Start ollama, pull the model, then keep the container running
|
| 12 |
+
# Note: Using sh -c to ensure the model pulls before the container starts serving
|
| 13 |
+
ENTRYPOINT ["sh", "-c", "ollama serve & sleep 10 && ollama pull qwen3.5:2b && wait"]
|
|
|
|
|
|
|
|
|
|
|
|