All checks were successful
Build and Push Docker Image / build (pull_request) Successful in 1m32s
47 lines
1.4 KiB
Docker
47 lines
1.4 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 docker CLI for swarm orchestration + pi globally for shell tool access
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends docker.io \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& 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"] |