ShriAishu commited on
Commit
7a1bbfe
·
verified ·
1 Parent(s): 087953f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -14
Dockerfile CHANGED
@@ -1,19 +1,13 @@
1
- # Use the official Ollama image
2
- FROM alpine/ollama
3
 
4
- # Set the environment variable for Hugging Face Spaces default port
5
  ENV OLLAMA_HOST=0.0.0.0:7860
 
6
 
7
- # Install curl to help with model pulling and health checks
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
- COPY start.sh ./start.sh
14
-
15
- # Use a startup script to run the server and pull the model
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"]