rc0873 commited on
Commit
cf4f1be
·
verified ·
1 Parent(s): 4b51904

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -13
Dockerfile CHANGED
@@ -1,26 +1,18 @@
1
- # 1. Base Image
2
  FROM ollama/ollama:latest
3
 
4
- # 2. Dependencies (curl, git, node)
5
  RUN apt-get update && apt-get install -y curl git && \
6
  curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
7
  apt-get install -y nodejs && \
8
  apt-get clean && rm -rf /var/lib/apt/lists/*
9
 
10
  WORKDIR /app
11
-
12
- # 3. Install OpenClaw
13
  RUN npm install -g openclaw@latest
14
 
15
- # 4. Expose Port for Hugging Face
16
  EXPOSE 7860
17
-
18
- # 5. Clear Entrypoint
19
  ENTRYPOINT []
20
 
21
- # 6. Full Robust Startup Script
22
- # - Ollama background mein chalega
23
- # - Wait loop: Jab tak Ollama ready nahi hota
24
- # - Pulling llama3.1 (Context window: 128k tokens)
25
- # - OpenClaw gateway fixed token ke sath
26
- CMD ["/bin/bash", "-c", "ollama serve & (until curl -s http://localhost:11434/api/tags > /dev/null; do sleep 1; done && ollama pull llama3.1) & openclaw gateway --port 7860 --bind 0.0.0.0 --auth token --token d868419fea3b0149b5e46fd1b4189b3cff18c0fa06c4d67c"]
 
 
1
  FROM ollama/ollama:latest
2
 
 
3
  RUN apt-get update && apt-get install -y curl git && \
4
  curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
5
  apt-get install -y nodejs && \
6
  apt-get clean && rm -rf /var/lib/apt/lists/*
7
 
8
  WORKDIR /app
 
 
9
  RUN npm install -g openclaw@latest
10
 
 
11
  EXPOSE 7860
 
 
12
  ENTRYPOINT []
13
 
14
+ # Startup Script optimized:
15
+ # 1. Ollama starts
16
+ # 2. Wait until it's ready, then PULL IN BACKGROUND (& symbol)
17
+ # 3. OpenClaw starts IMMEDIATELY to pass health check
18
+ CMD ["/bin/bash", "-c", "ollama serve & (until curl -s http://localhost:11434/api/tags > /dev/null; do sleep 2; done && ollama pull llama3.1 &) && openclaw gateway --port 7860 --bind 0.0.0.0 --auth token --token d868419fea3b0149b5e46fd1b4189b3cff18c0fa06c4d67c"]