chore: build from source instead of npm package

This commit is contained in:
WildDragon Deploy 2026-05-27 23:38:51 -04:00
parent 37047bd1af
commit 7c33b70122
2 changed files with 28 additions and 11 deletions

9
.dockerignore Normal file
View file

@ -0,0 +1,9 @@
node_modules
dist
dist-server
.git
claude-data
cloudcli-data
workspace
*.log
.env*

View file

@ -6,22 +6,30 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
jq ripgrep sqlite3 zip unzip tree vim-tiny curl git \
&& rm -rf /var/lib/apt/lists/*
# Install Claude Code CLI globally
RUN npm install -g @anthropic-ai/claude-code
# Install Claude Code CLI and Taskmaster globally
RUN npm install -g @anthropic-ai/claude-code task-master-ai
# Install CloudCLI (claudecodeui) globally
RUN npm install -g @cloudcli-ai/cloudcli
WORKDIR /app
# Install Taskmaster MCP
RUN npm install -g task-master-ai
# Install dependencies (separate layer for cache efficiency)
COPY package*.json ./
RUN npm ci
# Create workspace and data dirs with correct ownership
RUN mkdir -p /home/node/workspace /home/node/.cloudcli \
&& chown -R node:node /home/node/
# VITE_ vars must be present at build time (baked into frontend bundle)
ARG FORGEJO_BASE_URL=https://forge.wilddragon.net
ENV VITE_FORGEJO_BASE_URL=${FORGEJO_BASE_URL}
# Copy source and build
COPY . .
RUN npm run build
# Create persistent data dirs with correct ownership
RUN mkdir -p /home/node/workspace /home/node/.cloudcli /home/node/.claude \
&& chown -R node:node /home/node/ \
&& chown -R node:node /app
USER node
WORKDIR /home/node
EXPOSE 3001
CMD ["cloudcli", "start", "--port", "3001"]
CMD ["node", "dist-server/server/index.js"]