Files
agent/Dockerfile
highperfocused f03c96f964
Some checks failed
Build and Push Docker Image / build (push) Failing after 22s
moa agent
2026-03-11 23:21:57 +01:00

38 lines
1.2 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
CMD ["node", "dist/index.js"]