Files
gitops-automation/agent/Dockerfile
T
2026-08-23 11:25:28 +00:00

30 lines
802 B
Docker

FROM node:22-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
openssh-client \
ca-certificates \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g @anthropic-ai/claude-code
RUN useradd --create-home --shell /bin/bash agent && mkdir -p /workspace
WORKDIR /app
COPY package*.json ./
RUN npm install --omit=dev
COPY src ./src
RUN chown -R agent:agent /app /workspace
# Claude Code refuses to run with bypassPermissions as root — headless/unattended
# operation needs a non-root user.
USER agent
RUN git config --global user.email "claude-agent@apps.williamturner.eu" \
&& git config --global user.name "claude-agent" \
&& git config --global --add safe.directory '*'
ENV NODE_ENV=production
EXPOSE 3001
CMD ["node", "src/server.js"]