Awesome-Developer commited on
Commit
6eea9be
·
verified ·
1 Parent(s): 1e50f21

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -5
Dockerfile CHANGED
@@ -1,10 +1,10 @@
1
  FROM python:3.9
2
 
3
- # 1. Install dependencies: curl, zstd (for ollama)
4
  RUN apt-get update && apt-get install -y curl zstd
5
 
6
- # 2. Install sshx (Download first to avoid the 'sh' syntax error)
7
- RUN curl -sSf https://sshx.io/get.sh -o get_sshx.sh && sh get_sshx.sh && rm get_sshx.sh
8
 
9
  # 3. Install Ollama
10
  RUN curl -fsSL https://ollama.com/install.sh | sh
@@ -13,6 +13,8 @@ WORKDIR /app
13
  COPY . .
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- # 4. Start everything: Ollama (bg), sshx (bg), and Web App (fg)
17
- # This will print the sshx link directly into your Hugging Face Logs
 
 
18
  CMD ollama serve & (sleep 5 && sshx) & uvicorn app:app --host 0.0.0.0 --port 7860
 
1
  FROM python:3.9
2
 
3
+ # 1. Install dependencies: curl and zstd (required for Ollama)
4
  RUN apt-get update && apt-get install -y curl zstd
5
 
6
+ # 2. Install sshx (Direct install)
7
+ RUN curl -sSf https://sshx.io/get | sh
8
 
9
  # 3. Install Ollama
10
  RUN curl -fsSL https://ollama.com/install.sh | sh
 
13
  COPY . .
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ # 4. Start everything
17
+ # Ollama runs in background (&)
18
+ # sshx runs in background (&) and prints the link to logs
19
+ # Web app (uvicorn) stays in foreground to keep the Space alive
20
  CMD ollama serve & (sleep 5 && sshx) & uvicorn app:app --host 0.0.0.0 --port 7860