diff --git a/.gcloudignore b/.gcloudignore new file mode 100644 index 000000000..7de04e16b --- /dev/null +++ b/.gcloudignore @@ -0,0 +1,71 @@ +# Cloud Build ignore file +# Note: This overrides .gitignore for gcloud builds submit + +# Large directories not needed for build +.git +.worktrees +.bun-cache +.bun +.tmp +**/.tmp +.DS_Store +**/.DS_Store + +# Media files +*.png +*.jpg +*.jpeg +*.webp +*.gif +*.mp4 +*.mov +*.wav +*.mp3 + +# Dependencies (will be installed fresh) +node_modules +**/node_modules +.pnpm-store +**/.pnpm-store +.turbo +**/.turbo +.cache +**/.cache +.next +**/.next +coverage +**/coverage +*.log +tmp +**/tmp + +# Build artifacts (not needed, we rebuild) +dist +**/dist +apps/macos/.build +apps/ios/build +**/*.trace + +# Large app trees not needed for Docker build +apps/ +Peekaboo/ +Swabble/ +Core/ +Users/ +vendor/ + +# Keep assets, skills, extensions, docs (needed for runtime) +!assets/ +!skills/ +!extensions/ +!docs/ + +# Local files +.env +.conda-env +.envrc +.local/ +.vscode/ +IDENTITY.md +USER.md +.serena/ diff --git a/Dockerfile.production b/Dockerfile.production index 67e9e916b..f93b61df1 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -35,7 +35,8 @@ ENV CLAWDBOT_PREFER_PNPM=1 RUN pnpm ui:install RUN pnpm ui:build -# Prune dev dependencies for production +# Prune dev dependencies for production (CI=true avoids TTY prompt) +ENV CI=true RUN pnpm prune --prod # -------------------------------------------- @@ -52,17 +53,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ WORKDIR /app -# Copy only production artifacts +# Copy only production artifacts (dist/ includes control-ui from ui:build) COPY --from=builder /app/dist ./dist COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/package.json ./ -COPY --from=builder /app/assets ./assets -COPY --from=builder /app/skills ./skills -COPY --from=builder /app/extensions ./extensions -COPY --from=builder /app/docs ./docs -# Copy UI build output if present -COPY --from=builder /app/ui/dist ./ui/dist +# Copy optional runtime directories if they exist (using wildcards for optional copy) +COPY --from=builder /app/skill[s] ./skills/ +COPY --from=builder /app/extension[s] ./extensions/ +COPY --from=builder /app/doc[s] ./docs/ # Create non-root user (node user already exists in node image) RUN chown -R node:node /app @@ -77,4 +76,4 @@ HEALTHCHECK --interval=60s --timeout=5s --retries=2 \ ENV NODE_ENV=production -CMD ["node", "dist/index.js", "gateway", "--bind", "lan", "--port", "18789"] +CMD ["node", "dist/index.js", "gateway", "--bind", "lan", "--port", "18789", "--allow-unconfigured"] diff --git a/cloudbuild.yaml b/cloudbuild.yaml new file mode 100644 index 000000000..bf640dcdc --- /dev/null +++ b/cloudbuild.yaml @@ -0,0 +1,15 @@ +steps: + - name: 'gcr.io/cloud-builders/docker' + args: + - 'build' + - '-f' + - 'Dockerfile.production' + - '-t' + - 'gcr.io/$PROJECT_ID/clawdbot:latest' + - '.' + timeout: '1800s' + +images: + - 'gcr.io/$PROJECT_ID/clawdbot:latest' + +timeout: '2400s'