forked from stackblitz/bolt.new
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
408 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Ignore Git and GitHub files | ||
.git | ||
.github/ | ||
|
||
# Ignore Husky configuration files | ||
.husky/ | ||
|
||
# Ignore documentation and metadata files | ||
CONTRIBUTING.md | ||
LICENSE | ||
README.md | ||
|
||
# Ignore environment examples and sensitive info | ||
.env | ||
*.local | ||
*.example | ||
|
||
# Ignore node modules, logs and cache files | ||
**/*.log | ||
**/node_modules | ||
**/dist | ||
**/build | ||
**/.cache | ||
logs | ||
dist-ssr | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,5 @@ dist-ssr | |
*.vars | ||
.wrangler | ||
_worker.bundle | ||
|
||
Modelfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,67 @@ | ||
# Use an official Node.js runtime as the base image | ||
FROM node:20.15.1 | ||
ARG BASE=node:20.18.0 | ||
FROM ${BASE} AS base | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Install pnpm | ||
RUN npm install -g [email protected] | ||
# Install dependencies (this step is cached as long as the dependencies don't change) | ||
COPY package.json pnpm-lock.yaml ./ | ||
|
||
# Copy package.json and pnpm-lock.yaml (if available) | ||
COPY package.json pnpm-lock.yaml* ./ | ||
RUN corepack enable pnpm && pnpm install | ||
|
||
# Install dependencies | ||
RUN pnpm install | ||
|
||
# Copy the rest of the application code | ||
# Copy the rest of your app's source code | ||
COPY . . | ||
|
||
# Build the application | ||
RUN pnpm run build | ||
# Expose the port the app runs on | ||
EXPOSE 5173 | ||
|
||
# Production image | ||
FROM base AS bolt-ai-production | ||
|
||
# Define environment variables with default values or let them be overridden | ||
ARG GROQ_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 VITE_LOG_LEVEL=debug | ||
|
||
ENV WRANGLER_SEND_METRICS=false \ | ||
GROQ_API_KEY=${GROQ_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} \ | ||
VITE_LOG_LEVEL=${VITE_LOG_LEVEL} | ||
|
||
# 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-development | ||
|
||
# Make sure bindings.sh is executable | ||
RUN chmod +x bindings.sh | ||
# Define the same environment variables for development | ||
ARG GROQ_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 VITE_LOG_LEVEL=debug | ||
|
||
# Expose the port the app runs on (adjust if you specified a different port) | ||
EXPOSE 3000 | ||
ENV GROQ_API_KEY=${GROQ_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} \ | ||
VITE_LOG_LEVEL=${VITE_LOG_LEVEL} | ||
|
||
# Start the application | ||
CMD ["pnpm", "run", "start"] | ||
RUN mkdir -p ${WORKDIR}/run | ||
CMD pnpm run dev --host |
Oops, something went wrong.