FROM node:22-slim

# Required: node:22-slim has no system CA store and the Codex CLI is a Rust
# binary that validates TLS against it. See adolf-llm/Dockerfile for detail.
RUN apt-get update \
 && apt-get install -y --no-install-recommends ca-certificates \
 && rm -rf /var/lib/apt/lists/*

RUN npm install -g @openai/codex

WORKDIR /workspace

COPY server.js /app/server.js

ENV CODEX_HOME=/root/.codex

EXPOSE 8012

ENTRYPOINT ["node", "/app/server.js"]
