forked from gni/pi-coding-agent-container
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (50 loc) · 2.21 KB
/
Copy pathDockerfile
File metadata and controls
61 lines (50 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# syntax=docker/dockerfile:1
FROM node:22-bookworm-slim AS base
# Set environment variables for production and non-interactive installation
ENV NODE_ENV=production
ENV DEBIAN_FRONTEND=noninteractive
ENV NPM_CONFIG_LOGLEVEL=warn
# Install essential system tools required by pi-coding-agent and common dev workflows
# - git: Required for 'pi install git:...' and version control operations
# - curl/wget: For downloading external resources
# - procps: For process monitoring
# - build-essential: For compiling native add-ons (if extensions require them)
# - ca-certificates: Ensure SSL connections work securely
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
wget \
ca-certificates \
procps \
build-essential \
python3 \
&& rm -rf /var/lib/apt/lists/*
# -----------------------------------------------------------------------------
# Install GitHub CLI (gh)
# -----------------------------------------------------------------------------
RUN mkdir -p -m 755 /etc/apt/keyrings \
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt-get update \
&& apt-get install -y gh \
&& rm -rf /var/lib/apt/lists/*
FROM base AS release
# Install the pi-coding-agent globally
# We verify the registry connection implicitly during install
RUN npm install -g @mariozechner/pi-coding-agent
# Create a non-root user setup
# We use the existing 'node' user (UID 1000) provided by the base image
# Create the .pi directory structure to ensure permissions are correct when mounted
RUN mkdir -p /home/node/.pi/agent && \
mkdir -p /workspace && \
chown -R node:node /home/node/.pi && \
chown -R node:node /workspace
# Set the working directory to the project workspace
WORKDIR /workspace
# Switch to non-root user for security
USER node
# Verify installation
RUN pi --version
ENTRYPOINT ["pi"]
CMD []