Skip to content

Commit 3f6050b

Browse files
authored
Update Docker instructions and dev dependencies (#2032)
Expanded and clarified Docker usage instructions in README.md, including environment variable setup and workflow details. Updated @cloudflare/workers-types and wrangler dev dependencies in package.json to newer versions.
1 parent 5f92556 commit 3f6050b

File tree

3 files changed

+109
-86
lines changed

3 files changed

+109
-86
lines changed

README.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,29 +154,52 @@ You have two options for running Bolt.DIY: directly on your machine or using Doc
154154

155155
### Option 2: Using Docker
156156

157-
This option requires some familiarity with Docker but provides a more isolated environment.
157+
This option requires Docker and is great when you want an isolated environment or to mirror the production image.
158158

159159
#### Additional Prerequisite
160160

161161
- Install Docker: [Download Docker](https://www.docker.com/)
162162

163-
#### Steps:
163+
#### Steps
164164

165-
1. **Build the Docker Image**:
165+
1. **Prepare Environment Variables**
166+
167+
Copy the provided examples and add your provider keys:
168+
169+
```bash
170+
cp .env.example .env
171+
cp .env.example .env.local
172+
```
173+
174+
The runtime scripts inside the container source `.env` and `.env.local`, so keep any API keys you need in one of those files.
175+
176+
2. **Build an Image**
166177

167178
```bash
168-
# Using npm script:
169-
npm run dockerbuild
179+
# Development image (bind-mounts your local source when run)
180+
pnpm run dockerbuild
181+
# ≈ docker build -t bolt-ai:development -t bolt-ai:latest --target development .
170182
171-
# OR using direct Docker command:
172-
docker build . --target bolt-ai-development
183+
# Production image (self-contained build artifacts)
184+
pnpm run dockerbuild:prod
185+
# ≈ docker build -t bolt-ai:production -t bolt-ai:latest --target bolt-ai-production .
173186
```
174187

175-
2. **Run the Container**:
188+
3. **Run the Container**
189+
176190
```bash
191+
# Development workflow with hot reload
177192
docker compose --profile development up
193+
194+
# Production-style container using composed services
195+
docker compose --profile production up
196+
197+
# One-off production container (exposes the app on port 5173)
198+
docker run --rm -p 5173:5173 --env-file .env.local bolt-ai:latest
178199
```
179200

201+
When the container starts it runs `pnpm run dockerstart`, which in turn executes `bindings.sh` to pass Cloudflare bindings through Wrangler. You can override this command in `docker-compose.yaml` if you need a different startup routine.
202+
180203
### Option 3: Desktop Application (Electron)
181204

182205
For users who prefer a native desktop experience, bolt.diy is also available as an Electron desktop application:

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
},
162162
"devDependencies": {
163163
"@blitz/eslint-plugin": "0.1.0",
164-
"@cloudflare/workers-types": "^4.20241127.0",
164+
"@cloudflare/workers-types": "^4.20251011.0",
165165
"@electron/notarize": "^2.5.0",
166166
"@iconify-json/ph": "^1.2.1",
167167
"@iconify/types": "^2.0.0",
@@ -204,7 +204,7 @@
204204
"vite-plugin-optimize-css-modules": "^1.1.0",
205205
"vite-tsconfig-paths": "^4.3.2",
206206
"vitest": "^2.1.7",
207-
"wrangler": "^4.5.1"
207+
"wrangler": "^4.44.0"
208208
},
209209
"resolutions": {
210210
"@typescript-eslint/utils": "^8.0.0-alpha.30"

0 commit comments

Comments
 (0)