forked from stackblitz/bolt.new
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix duplicate exports and update Dockerfile
- Loading branch information
root
committed
Mar 11, 2025
1 parent
50dd74d
commit d33e686
Showing
3 changed files
with
42 additions
and
85 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 |
---|---|---|
@@ -1,95 +1,32 @@ | ||
ARG BASE=node:20.18.0 | ||
FROM ${BASE} AS base | ||
# Use Node.js 18 as the base image | ||
FROM node:18 | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Install dependencies (this step is cached as long as the dependencies don't change) | ||
COPY package.json pnpm-lock.yaml ./ | ||
# Install Core Utilities | ||
RUN apt-get update && apt-get install -y curl | ||
|
||
#RUN npm install -g corepack@latest | ||
# Remove existing PNPM installation if it exists | ||
RUN rm -rf /usr/local/bin/pnpm /root/.local/share/pnpm | ||
|
||
#RUN corepack enable pnpm && pnpm install | ||
RUN npm install -g pnpm && pnpm install | ||
# Install PNPM properly | ||
RUN curl -fsSL https://get.pnpm.io/install.sh | bash | ||
|
||
# Copy the rest of your app's source code | ||
COPY . . | ||
|
||
# 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 HuggingFace_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 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 | ||
# Ensure PNPM is accessible globally | ||
ENV PATH="/root/.local/share/pnpm:/usr/local/bin:$PATH" | ||
|
||
ENV WRANGLER_SEND_METRICS=false \ | ||
GROQ_API_KEY=${GROQ_API_KEY} \ | ||
HuggingFace_KEY=${HuggingFace_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} \ | ||
XAI_API_KEY=${XAI_API_KEY} \ | ||
TOGETHER_API_KEY=${TOGETHER_API_KEY} \ | ||
TOGETHER_API_BASE_URL=${TOGETHER_API_BASE_URL} \ | ||
AWS_BEDROCK_CONFIG=${AWS_BEDROCK_CONFIG} \ | ||
VITE_LOG_LEVEL=${VITE_LOG_LEVEL} \ | ||
DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX}\ | ||
RUNNING_IN_DOCKER=true | ||
# Copy package.json and lock file first (optimizes caching) | ||
COPY package*.json pnpm-lock.yaml ./ | ||
|
||
# Pre-configure wrangler to disable metrics | ||
RUN mkdir -p /root/.config/.wrangler && \ | ||
echo '{"enabled":false}' > /root/.config/.wrangler/metrics.json | ||
# Install dependencies | ||
RUN /root/.local/share/pnpm/pnpm install | ||
|
||
RUN pnpm run build | ||
|
||
CMD [ "pnpm", "run", "dockerstart"] | ||
|
||
# Development image | ||
FROM base AS bolt-ai-development | ||
|
||
# Define the same environment variables for development | ||
ARG GROQ_API_KEY | ||
ARG HuggingFace | ||
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 XAI_API_KEY | ||
ARG TOGETHER_API_KEY | ||
ARG TOGETHER_API_BASE_URL | ||
ARG VITE_LOG_LEVEL=debug | ||
ARG DEFAULT_NUM_CTX | ||
# Copy all project files into the container | ||
COPY . . | ||
|
||
ENV GROQ_API_KEY=${GROQ_API_KEY} \ | ||
HuggingFace_API_KEY=${HuggingFace_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} \ | ||
XAI_API_KEY=${XAI_API_KEY} \ | ||
TOGETHER_API_KEY=${TOGETHER_API_KEY} \ | ||
TOGETHER_API_BASE_URL=${TOGETHER_API_BASE_URL} \ | ||
AWS_BEDROCK_CONFIG=${AWS_BEDROCK_CONFIG} \ | ||
VITE_LOG_LEVEL=${VITE_LOG_LEVEL} \ | ||
DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX}\ | ||
RUNNING_IN_DOCKER=true | ||
# Expose the default Vite development port | ||
EXPOSE 5173 | ||
|
||
RUN mkdir -p ${WORKDIR}/run | ||
CMD pnpm run dev --host | ||
# Start the app | ||
CMD ["pnpm", "run", "dev", "--host"] |
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,11 @@ | ||
version: '3.8' | ||
|
||
services: | ||
bolt-diy: | ||
build: . | ||
container_name: bolt-diy | ||
restart: always | ||
ports: | ||
- "8080:8080" | ||
env_file: | ||
- .env |
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