Files
agent/Dockerfile
highperfocused 5443cdddbf
Some checks failed
Build and Push Docker Image / build (pull_request) Failing after 1m48s
Add HTTP gateway with streaming chat and multi-client conversation mapping
2026-03-12 11:50:15 +01:00

44 lines
1.3 KiB
Docker

# ─── build stage ─────────────────────────────────────────────────────────────
FROM node:24-slim AS builder
WORKDIR /agent
# Install all deps (including dev deps required by tsc)
COPY package*.json tsconfig.json ./
RUN npm ci
COPY src/ ./src/
# Compile TypeScript → /agent/dist/
RUN npm run build
# Prune dev deps for the final image
RUN npm prune --omit=dev
# ─── runtime stage ────────────────────────────────────────────────────────────
FROM node:24-slim
# Install pi globally so it is available as a shell tool (e.g. inside bash tool)
RUN npm install -g @mariozechner/pi-coding-agent
WORKDIR /agent
# Copy compiled app + production deps
COPY --from=builder /agent/dist ./dist
COPY --from=builder /agent/node_modules ./node_modules
COPY package.json ./
# /app is the project directory mounted at runtime
VOLUME ["/app"]
ENV NODE_ENV=production
# Default working directory for the agent (overridable via CWD env var)
ENV CWD=/app
# Gateway defaults
ENV RUN_MODE=gateway
ENV GATEWAY_HOST=0.0.0.0
ENV GATEWAY_PORT=8787
EXPOSE 8787
CMD ["node", "dist/index.js"]