Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ jobs:
- name: Test Docker build (without push)
run: |
echo "Testing Docker build configuration..."
docker build --target bolt-ai-production . --no-cache --progress=plain
docker build --target runtime . --no-cache --progress=plain
echo "✅ Docker build test completed"

test-results-summary:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

investigations

node_modules
dist
dist-ssr
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ npm run dockerbuild
**Option 2: Direct Docker Build Command**

```bash
docker build . --target bolt-ai-development
docker build . --target development
```

**Option 3: Docker Compose Profile**
Expand Down Expand Up @@ -184,7 +184,7 @@ npm run dockerbuild:prod
**Option 2: Direct Docker Build Command**

```bash
docker build . --target bolt-ai-production
docker build . --target runtime
```

**Option 3: Docker Compose Profile**
Expand Down
36 changes: 23 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENV HUSKY=0
ENV CI=true

# Use pnpm
RUN corepack enable && corepack prepare pnpm@9.15.9 --activate
RUN corepack enable && corepack prepare pnpm@9.14.4 --activate

# Accept (optional) build-time public URL for Remix/Vite (Coolify can pass it)
ARG VITE_PUBLIC_APP_URL
Expand All @@ -25,35 +25,44 @@ RUN pnpm install --offline --frozen-lockfile
# Build the Remix app (SSR + client)
RUN NODE_OPTIONS=--max-old-space-size=4096 pnpm run build

# Keep only production deps for runtime
RUN pnpm prune --prod --ignore-scripts


# ---- runtime stage ----
FROM node:22-bookworm-slim AS runtime
WORKDIR /app

ENV NODE_ENV=production
ENV PORT=3000
ENV PORT=5173
ENV HOST=0.0.0.0

# Install curl so Coolify’s healthcheck works inside the image
RUN apt-get update && apt-get install -y --no-install-recommends curl \
RUN apt-get update && apt-get install -y --no-install-recommends curl bash \
&& rm -rf /var/lib/apt/lists/*

# Copy only what we need to run
# Enable pnpm (needed for dockerstart script)
RUN corepack enable && corepack prepare pnpm@9.14.4 --activate

# Copy built application and dependencies (including wrangler)
COPY --from=build /app/build /app/build
COPY --from=build /app/node_modules /app/node_modules
COPY --from=build /app/package.json /app/package.json

EXPOSE 3000
# Copy required files for wrangler pages dev
COPY --from=build /app/bindings.sh /app/bindings.sh
COPY --from=build /app/wrangler.toml /app/wrangler.toml
COPY --from=build /app/functions /app/functions
COPY --from=build /app/worker-configuration.d.ts /app/worker-configuration.d.ts

# Make bindings.sh executable
RUN chmod +x /app/bindings.sh

EXPOSE 5173

# Healthcheck for Coolify
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=5 \
CMD curl -fsS http://localhost:3000/ || exit 1
# Healthcheck for Coolify (use correct port)
HEALTHCHECK --interval=10s --timeout=3s --start-period=10s --retries=5 \
CMD curl -fsS http://localhost:5173/ || exit 1

# Start the Remix server
CMD ["node", "build/server/index.js"]
# Start with wrangler pages dev (as per dockerstart script)
CMD ["pnpm", "run", "dockerstart"]


# ---- development stage ----
Expand All @@ -70,6 +79,7 @@ ARG OLLAMA_API_BASE_URL
ARG XAI_API_KEY
ARG TOGETHER_API_KEY
ARG TOGETHER_API_BASE_URL
ARG AWS_BEDROCK_CONFIG
ARG VITE_LOG_LEVEL=debug
ARG DEFAULT_NUM_CTX

Expand Down
10 changes: 4 additions & 6 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ services:
build:
context: .
dockerfile: Dockerfile
target: bolt-ai-production
target: runtime
ports:
- '5173:5173'
env_file:
- '.env'
- '.env.local'
environment:
- NODE_ENV=production
- COMPOSE_PROFILES=production
# No strictly needed but serving as hints for Coolify
- PORT=5173
- GROQ_API_KEY=${GROQ_API_KEY}
- HuggingFace_API_KEY=${HuggingFace_API_KEY}
Expand All @@ -38,7 +36,9 @@ services:
app-dev:
image: bolt-ai:development
build:
target: bolt-ai-development
context: .
dockerfile: Dockerfile
target: development
env_file:
- '.env'
- '.env.local'
Expand Down Expand Up @@ -83,8 +83,6 @@ services:
- '5173:5173'
environment:
- NODE_ENV=production
- COMPOSE_PROFILES=production
# No strictly needed but serving as hints for Coolify
- PORT=5173
- OLLAMA_API_BASE_URL=http://127.0.0.1:11434
- DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX:-32768}
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ npm run dockerbuild
**Option 2: Direct Docker Build Command**

```bash
docker build . --target bolt-ai-development
docker build . --target development
```

**Option 3: Docker Compose Profile**
Expand Down Expand Up @@ -193,7 +193,7 @@ npm run dockerbuild:prod
**Option 2: Direct Docker Build Command**

```bash
docker build . --target bolt-ai-production
docker build . --target runtime
```

**Option 3: Docker Compose Profile**
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"start": "node -e \"const { spawn } = require('child_process'); const isWindows = process.platform === 'win32'; const cmd = isWindows ? 'npm run start:windows' : 'npm run start:unix'; const child = spawn(cmd, { shell: true, stdio: 'inherit' }); child.on('exit', code => process.exit(code));\"",
"dockerstart": "bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings --ip 0.0.0.0 --port 5173 --no-show-interactive-dev-session",
"dockerrun": "docker run -it -d --name bolt-ai-live -p 5173:5173 --env-file .env.local bolt-ai",
"dockerbuild:prod": "docker build -t bolt-ai:production -t bolt-ai:latest --target bolt-ai-production .",
"dockerbuild": "docker build -t bolt-ai:development -t bolt-ai:latest --target bolt-ai-development .",
"dockerbuild:prod": "docker build -t bolt-ai:production -t bolt-ai:latest --target runtime .",
"dockerbuild": "docker build -t bolt-ai:development -t bolt-ai:latest --target development .",
"typecheck": "tsc",
"typegen": "wrangler types",
"preview": "pnpm run build && pnpm run start",
Expand All @@ -35,7 +35,7 @@
"electron:build:deps": "concurrently \"pnpm electron:build:main\" \"pnpm electron:build:preload\" --kill-others-on-fail",
"electron:build:main": "vite build --config ./electron/main/vite.config.ts",
"electron:build:preload": "vite build --config ./electron/preload/vite.config.ts",
"electron:build:renderer": "remix vite:build --config vite-electron.config.js",
"electron:build:renderer": "remix vite:build --config vite-electron.config.ts",
"electron:build:unpack": "rm -rf dist && pnpm electron:build:renderer && pnpm electron:build:deps && electron-builder --dir",
"electron:build:mac": "rm -rf dist && pnpm electron:build:renderer && pnpm electron:build:deps && electron-builder --mac",
"electron:build:win": "rm -rf dist && pnpm electron:build:renderer && pnpm electron:build:deps && electron-builder --win",
Expand Down
Loading