From 4eb7140fd3400dc9b3c41a2db26282b7754d6b10 Mon Sep 17 00:00:00 2001 From: Stijnus <72551117+Stijnus@users.noreply.github.com> Date: Tue, 16 Sep 2025 11:33:51 +0200 Subject: [PATCH] fix: resolve Docker build syntax errors (#1996) (#1999) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: resolve Docker build syntax errors and merge conflicts - Fix incomplete ARG HuggingFace declaration to ARG HuggingFace_API_KEY - Fix invalid WORKDIR variable reference ${WORKDIR}/run to /app/run - Resolve merge conflicts preserving both runtime and development stages - Add proper development stage with corrected environment variables - Ensure both dockerbuild and dockerbuild:prod targets work correctly Resolves Docker build error: "target stage 'bolt-ai-development' could not be found" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * ci: add comprehensive Docker build validation to main CI pipeline - Add docker-validation job to ci.yaml workflow - Test both runtime (production) and development Docker targets - Validate docker-compose configuration syntax - Run on all PRs and pushes to catch Docker build issues early - Set 15-minute timeout to prevent hanging builds - Use --no-cache and --progress=plain for reliable validation This ensures Docker build syntax errors like #1996 are caught in CI before they reach main branch, preventing deployment failures. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * fix: use modern docker compose command syntax in CI - Change docker-compose to docker compose (GitHub Actions uses Docker Compose v2) - Fixes CI failure: docker-compose: command not found - Ensures docker-compose validation works in GitHub Actions runners --------- Co-authored-by: Claude --- .github/workflows/ci.yaml | 30 ++++++++++++++++++++++++++++++ Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2b83f80..12434a0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -58,3 +58,33 @@ jobs: name: coverage-report path: coverage/ retention-days: 7 + + docker-validation: + name: Docker Build Validation + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Validate Docker production build + run: | + echo "🐳 Testing Docker production target..." + docker build --target runtime . --no-cache --progress=plain + echo "✅ Production target builds successfully" + + - name: Validate Docker development build + run: | + echo "🐳 Testing Docker development target..." + docker build --target development . --no-cache --progress=plain + echo "✅ Development target builds successfully" + + - name: Validate docker-compose configuration + run: | + echo "🐳 Validating docker-compose configuration..." + docker compose config --quiet + echo "✅ docker-compose configuration is valid" diff --git a/Dockerfile b/Dockerfile index 08367cd..44960e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,3 +54,39 @@ HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=5 \ # Start the Remix server CMD ["node", "build/server/index.js"] + + +# ---- development stage ---- +FROM build AS development + +# Define environment variables for development +ARG GROQ_API_KEY +ARG HuggingFace_API_KEY +ARG OPENAI_API_KEY +ARG ANTHROPIC_API_KEY +ARG OPEN_ROUTER_API_KEY +ARG GOOGLE_GENERATIVE_AI_API_KEY +ARG OLLAMA_API_BASE_URL +ARG XAI_API_KEY +ARG TOGETHER_API_KEY +ARG TOGETHER_API_BASE_URL +ARG VITE_LOG_LEVEL=debug +ARG DEFAULT_NUM_CTX + +ENV GROQ_API_KEY=${GROQ_API_KEY} \ + HuggingFace_API_KEY=${HuggingFace_API_KEY} \ + OPENAI_API_KEY=${OPENAI_API_KEY} \ + ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} \ + OPEN_ROUTER_API_KEY=${OPEN_ROUTER_API_KEY} \ + GOOGLE_GENERATIVE_AI_API_KEY=${GOOGLE_GENERATIVE_AI_API_KEY} \ + OLLAMA_API_BASE_URL=${OLLAMA_API_BASE_URL} \ + XAI_API_KEY=${XAI_API_KEY} \ + TOGETHER_API_KEY=${TOGETHER_API_KEY} \ + TOGETHER_API_BASE_URL=${TOGETHER_API_BASE_URL} \ + AWS_BEDROCK_CONFIG=${AWS_BEDROCK_CONFIG} \ + VITE_LOG_LEVEL=${VITE_LOG_LEVEL} \ + DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX} \ + RUNNING_IN_DOCKER=true + +RUN mkdir -p /app/run +CMD ["pnpm", "run", "dev", "--host"]