Spaces:
Paused
Paused
File size: 609 Bytes
e53a242 6eea9be 8c5ab59 1e50f21 6eea9be 1e50f21 e53a242 131ce87 e53a242 6eea9be 1e50f21 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | FROM python:3.9
# 1. Install dependencies: curl and zstd (required for Ollama)
RUN apt-get update && apt-get install -y curl zstd
# 2. Install sshx (Direct install)
RUN curl -sSf https://sshx.io/get | sh
# 3. Install Ollama
RUN curl -fsSL https://ollama.com/install.sh | sh
WORKDIR /app
COPY . .
RUN pip install --no-cache-dir -r requirements.txt
# 4. Start everything
# Ollama runs in background (&)
# sshx runs in background (&) and prints the link to logs
# Web app (uvicorn) stays in foreground to keep the Space alive
CMD ollama serve & (sleep 5 && sshx) & uvicorn app:app --host 0.0.0.0 --port 7860 |