Skip to content

Commit

Permalink
Enabled boh dev and production docker images. Added convenience scrip…
Browse files Browse the repository at this point in the history
…ts and deconflicted start and dockerstart scripts
  • Loading branch information
Colin Hill committed Oct 24, 2024
1 parent 7448666 commit fdc2f6c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM node:20.18.0
ARG BASE=node:20.18.0
FROM ${BASE} AS base

WORKDIR /app

Expand All @@ -13,4 +14,19 @@ COPY . .
# Expose the port the app runs on
EXPOSE 5173

CMD [ "pnpm", "run", "dev", "--host" ]
# Production image
FROM base AS bolt-ai-production

ENV WRANGLER_SEND_METRICS=false

# Pre-configure wrangler to disable metrics
RUN mkdir -p /root/.config/.wrangler && \
echo '{"enabled":false}' > /root/.config/.wrangler/metrics.json

RUN npm run build

CMD [ "pnpm", "run", "dockerstart"]

# Development image
FROM base AS bolt-ai-dev
ENTRYPOINT ["pnpm", "run", "dev", "--host"]
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
"lint:fix": "npm run lint -- --fix",
"start": "bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings",
"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 bolt-ai:latest --target bolt-ai-production .",
"dockerbuild": "docker build -t bolt-ai:development -t bolt-ai:latest --target bolt-ai-dev .",
"typecheck": "tsc",
"typegen": "wrangler types",
"preview": "pnpm run build && pnpm run start"
Expand Down
1 change: 1 addition & 0 deletions wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ name = "bolt"
compatibility_flags = ["nodejs_compat"]
compatibility_date = "2024-07-01"
pages_build_output_dir = "./build/client"
send_metrics = false

0 comments on commit fdc2f6c

Please sign in to comment.