# syntax=docker/dockerfile:1 FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive ENV PYTHONUNBUFFERED=1 ENV PIP_NO_CACHE_DIR=1 # ---------------------------- # App / Ollama environment # ---------------------------- ENV MODEL_NAME="hf.co/rahul7star/Qwen3-4B-Thinking-2509-Genius-Coder-AI-Full:Q5_K_M" ENV OLLAMA_HOST="0.0.0.0:11434" ENV OLLAMA_ORIGINS="*" ENV OLLAMA_NUM_PARALLEL="1" ENV OLLAMA_MAX_LOADED_MODELS="1" ENV OLLAMA_KEEP_ALIVE="-1" ENV HF_HOME="/data/.cache/huggingface" ENV TRANSFORMERS_CACHE="/data/.cache/huggingface" ENV OLLAMA_MODELS="/data/.ollama/models" # ---------------------------- # System dependencies # ---------------------------- RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ git \ bash \ python3 \ python3-pip \ python3-venv \ build-essential \ libcurl4 \ libcurl4-openssl-dev \ libcjson-dev \ zstd \ && rm -rf /var/lib/apt/lists/* # ---------------------------- # Install Ollama # Official install path is more reliable than grabbing a raw binary # ---------------------------- RUN curl -fsSL https://ollama.com/install.sh | sh && \ ollama --version # ---------------------------- # Python dependencies # Remove torch packages unless your UI truly needs them # ---------------------------- RUN python3 -m pip install --upgrade pip setuptools wheel && \ pip3 install \ gradio==4.44.0 \ streamlit \ huggingface_hub==0.23.5 \ requests \ redis # ---------------------------- # Working directory # ---------------------------- WORKDIR /workspace # ---------------------------- # Copy app files # ---------------------------- COPY . /workspace/ # ---------------------------- # Create required dirs # ---------------------------- RUN mkdir -p /data /workspace/data /root/.ollama && \ chmod +x /workspace/entrypoint.sh && \ chmod +x /workspace/pygmyclaw.py || true && \ chmod +x /workspace/pygmyclaw_multitool.py || true # ---------------------------- # HF public port # Ollama stays internal on 11434 # ---------------------------- EXPOSE 7860 # ---------------------------- # Start script # ---------------------------- CMD ["bash", "/workspace/entrypoint.sh"]