|
| 1 | +# Python runtime for LLM API inference (OpenAI & Claude) |
| 2 | +# This module makes API calls to OpenAI and Anthropic for LLM inference |
| 3 | +# For the full fat container with Ollama & local models, see Dockerfile.ollama |
| 4 | +# Based on: /Users/0xj0/Documents/projects/LQL/CONSTRUCTIVE/agentic-foundation |
| 5 | + |
| 6 | +##################### heres what is had inside of (/Users/0xj0/Documents/projects/LQL/CONSTRUCTIVE/agentic-foundation) -- GO VERIFY YOURSELF |
| 7 | + |
| 8 | +# Builder Stage |
| 9 | +FROM rust:latest as builder |
| 10 | +WORKDIR /app |
| 11 | +COPY . . |
| 12 | +# Build agent_core |
| 13 | +RUN cargo build --release --bin agent_core |
| 14 | + |
| 15 | +# Runtime Stage - "Fat Container" |
| 16 | +FROM ubuntu:22.04 |
| 17 | +WORKDIR /app |
| 18 | + |
| 19 | +# Set non-interactive install |
| 20 | +ENV DEBIAN_FRONTEND=noninteractive |
| 21 | + |
| 22 | +# 1. Install Basic Tools & Runtimes (Python, Node, System Utils) |
| 23 | +RUN apt-get update && apt-get install -y \ |
| 24 | + curl wget git build-essential \ |
| 25 | + python3 python3-pip python3-venv \ |
| 26 | + nodejs npm \ |
| 27 | + postgresql-14 postgresql-client-14 \ |
| 28 | + sudo \ |
| 29 | + libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 \ |
| 30 | + libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2 \ |
| 31 | + chromium-browser \ |
| 32 | + && rm -rf /var/lib/apt/lists/* |
| 33 | + |
| 34 | +# 2. Install Rust in Runtime (for the agent to use `cargo`) |
| 35 | +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
| 36 | +ENV PATH="/root/.cargo/bin:${PATH}" |
| 37 | + |
| 38 | +# 3. Install PostGraphile |
| 39 | +RUN npm install -g postgraphile @graphile-contrib/pg-simplify-inflector |
| 40 | + |
| 41 | +# 4. Install Ollama & Bake Models |
| 42 | +# We install Ollama, then start it in the background to pull models into the image layers. |
| 43 | +RUN curl -fsSL https://ollama.com/install.sh | sh |
| 44 | + |
| 45 | +# Pre-pull Models (Using available equivalents for the '2025' spec models) |
| 46 | +# GPT-OSS -> llama3.2 (Small, open, robust) |
| 47 | +# Qwen3-VL -> llava (Vision model standard in Ollama) |
| 48 | +# Devstral -> qwen2.5-coder (Excellent coding model) |
| 49 | +# Nemotron -> mistral (Strong reasoning) |
| 50 | +RUN nohup bash -c "ollama serve" & \ |
| 51 | + sleep 10 && \ |
| 52 | + ollama pull llama3.2 && \ |
| 53 | + ollama pull llava && \ |
| 54 | + ollama pull qwen2.5-coder && \ |
| 55 | + ollama pull mistral && \ |
| 56 | + pkill ollama |
| 57 | + |
| 58 | +# 5. Setup Data & Permissions |
| 59 | +RUN mkdir -p /var/lib/postgresql/data && chown -R postgres:postgres /var/lib/postgresql/data |
| 60 | + |
| 61 | +# 6. Copy Binaries & Scripts |
| 62 | +COPY --from=builder /app/target/release/agent_core /app/agent_core |
| 63 | +COPY scripts/entrypoint.sh /app/entrypoint.sh |
| 64 | +RUN chmod +x /app/entrypoint.sh |
| 65 | + |
| 66 | +# 7. Config |
| 67 | +ENV DATABASE_URL=postgres://agent:agent@localhost:5432/agentic |
| 68 | +ENV OLLAMA_HOST=0.0.0.0:11434 |
| 69 | + |
| 70 | +EXPOSE 3000 5432 11434 5000 |
| 71 | + |
| 72 | +ENTRYPOINT ["/app/entrypoint.sh"] |
| 73 | +CMD ["./agent_core"] |
0 commit comments