Colin Hill commited on
Commit
fdc2f6c
·
1 Parent(s): 7448666

Enabled boh dev and production docker images. Added convenience scripts and deconflicted start and dockerstart scripts

Browse files
Files changed (3) hide show
  1. Dockerfile +18 -2
  2. package.json +4 -0
  3. wrangler.toml +1 -0
Dockerfile CHANGED
@@ -1,4 +1,5 @@
1
- FROM node:20.18.0
 
2
 
3
  WORKDIR /app
4
 
@@ -13,4 +14,19 @@ COPY . .
13
  # Expose the port the app runs on
14
  EXPOSE 5173
15
 
16
- CMD [ "pnpm", "run", "dev", "--host" ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ARG BASE=node:20.18.0
2
+ FROM ${BASE} AS base
3
 
4
  WORKDIR /app
5
 
 
14
  # Expose the port the app runs on
15
  EXPOSE 5173
16
 
17
+ # Production image
18
+ FROM base AS bolt-ai-production
19
+
20
+ ENV WRANGLER_SEND_METRICS=false
21
+
22
+ # Pre-configure wrangler to disable metrics
23
+ RUN mkdir -p /root/.config/.wrangler && \
24
+ echo '{"enabled":false}' > /root/.config/.wrangler/metrics.json
25
+
26
+ RUN npm run build
27
+
28
+ CMD [ "pnpm", "run", "dockerstart"]
29
+
30
+ # Development image
31
+ FROM base AS bolt-ai-dev
32
+ ENTRYPOINT ["pnpm", "run", "dev", "--host"]
package.json CHANGED
@@ -15,6 +15,10 @@
15
  "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
16
  "lint:fix": "npm run lint -- --fix",
17
  "start": "bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings",
 
 
 
 
18
  "typecheck": "tsc",
19
  "typegen": "wrangler types",
20
  "preview": "pnpm run build && pnpm run start"
 
15
  "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
16
  "lint:fix": "npm run lint -- --fix",
17
  "start": "bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings",
18
+ "dockerstart": "bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings --ip 0.0.0.0 --port 5173 --no-show-interactive-dev-session",
19
+ "dockerrun": "docker run -it -d --name bolt-ai-live -p 5173:5173 --env-file .env.local bolt-ai",
20
+ "dockerbuild-prod": "docker build -t bolt-ai:production bolt-ai:latest --target bolt-ai-production .",
21
+ "dockerbuild": "docker build -t bolt-ai:development -t bolt-ai:latest --target bolt-ai-dev .",
22
  "typecheck": "tsc",
23
  "typegen": "wrangler types",
24
  "preview": "pnpm run build && pnpm run start"
wrangler.toml CHANGED
@@ -3,3 +3,4 @@ name = "bolt"
3
  compatibility_flags = ["nodejs_compat"]
4
  compatibility_date = "2024-07-01"
5
  pages_build_output_dir = "./build/client"
 
 
3
  compatibility_flags = ["nodejs_compat"]
4
  compatibility_date = "2024-07-01"
5
  pages_build_output_dir = "./build/client"
6
+ send_metrics = false