Awesome-Developer commited on
Commit
1e50f21
·
verified ·
1 Parent(s): 8c5ab59

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -5
Dockerfile CHANGED
@@ -1,14 +1,18 @@
1
  FROM python:3.9
2
 
3
- # 1. Install dependencies: curl, zstd (for ollama), and sshx
4
  RUN apt-get update && apt-get install -y curl zstd
5
- RUN curl -sSf https://sshx.io/get.sh | sh
 
 
 
 
6
  RUN curl -fsSL https://ollama.com/install.sh | sh
7
 
8
  WORKDIR /app
9
  COPY . .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
- # 2. Start Ollama and sshx in the background, then run the app
13
- # The 'sshx' command will print a URL to your Hugging Face logs
14
- CMD ollama serve & sshx & uvicorn app:app --host 0.0.0.0 --port 7860
 
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
11
 
12
  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