2024-10-24 07:54:45 +00:00
|
|
|
ARG BASE=node:20.18.0
|
|
|
|
FROM ${BASE} AS base
|
2024-10-06 14:12:49 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2024-10-10 01:56:25 +00:00
|
|
|
# Install dependencies (this step is cached as long as the dependencies don't change)
|
2024-10-10 02:51:11 +00:00
|
|
|
COPY package.json pnpm-lock.yaml ./
|
|
|
|
|
|
|
|
RUN corepack enable pnpm && pnpm install
|
2024-10-10 01:56:25 +00:00
|
|
|
|
2024-10-06 14:12:49 +00:00
|
|
|
# Copy the rest of your app's source code
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# Expose the port the app runs on
|
|
|
|
EXPOSE 5173
|
|
|
|
|
2024-10-24 07:54:45 +00:00
|
|
|
# Production image
|
|
|
|
FROM base AS bolt-ai-production
|
|
|
|
|
2024-10-24 18:50:45 +00:00
|
|
|
# Define environment variables with default values or let them be overridden
|
|
|
|
ARG GROQ_API_KEY
|
2024-11-17 23:49:02 +00:00
|
|
|
ARG HuggingFace_API_KEY
|
2024-10-24 18:50:45 +00:00
|
|
|
ARG OPENAI_API_KEY
|
|
|
|
ARG ANTHROPIC_API_KEY
|
|
|
|
ARG OPEN_ROUTER_API_KEY
|
|
|
|
ARG GOOGLE_GENERATIVE_AI_API_KEY
|
|
|
|
ARG OLLAMA_API_BASE_URL
|
2024-11-23 05:20:35 +00:00
|
|
|
ARG TOGETHER_API_KEY
|
|
|
|
ARG TOGETHER_API_BASE_URL
|
2024-10-24 18:50:45 +00:00
|
|
|
ARG VITE_LOG_LEVEL=debug
|
2024-11-19 07:46:51 +00:00
|
|
|
ARG DEFAULT_NUM_CTX
|
2024-10-24 18:50:45 +00:00
|
|
|
|
|
|
|
ENV WRANGLER_SEND_METRICS=false \
|
|
|
|
GROQ_API_KEY=${GROQ_API_KEY} \
|
2024-11-17 23:49:02 +00:00
|
|
|
HuggingFace_KEY=${HuggingFace_API_KEY} \
|
2024-10-24 18:50:45 +00:00
|
|
|
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} \
|
2024-11-23 05:20:35 +00:00
|
|
|
TOGETHER_API_KEY=${TOGETHER_API_KEY} \
|
|
|
|
TOGETHER_API_BASE_URL=${TOGETHER_API_BASE_URL} \
|
2024-11-19 07:46:51 +00:00
|
|
|
VITE_LOG_LEVEL=${VITE_LOG_LEVEL} \
|
|
|
|
DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX}
|
2024-10-24 07:54:45 +00:00
|
|
|
|
|
|
|
# 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
|
2024-10-24 18:48:05 +00:00
|
|
|
FROM base AS bolt-ai-development
|
2024-10-24 18:50:45 +00:00
|
|
|
|
|
|
|
# Define the same environment variables for development
|
|
|
|
ARG GROQ_API_KEY
|
2024-11-17 23:49:02 +00:00
|
|
|
ARG HuggingFace
|
2024-10-24 18:50:45 +00:00
|
|
|
ARG OPENAI_API_KEY
|
|
|
|
ARG ANTHROPIC_API_KEY
|
|
|
|
ARG OPEN_ROUTER_API_KEY
|
|
|
|
ARG GOOGLE_GENERATIVE_AI_API_KEY
|
|
|
|
ARG OLLAMA_API_BASE_URL
|
2024-11-23 05:20:35 +00:00
|
|
|
ARG TOGETHER_API_KEY
|
|
|
|
ARG TOGETHER_API_BASE_URL
|
2024-10-24 18:50:45 +00:00
|
|
|
ARG VITE_LOG_LEVEL=debug
|
2024-11-19 07:46:51 +00:00
|
|
|
ARG DEFAULT_NUM_CTX
|
2024-10-24 18:50:45 +00:00
|
|
|
|
|
|
|
ENV GROQ_API_KEY=${GROQ_API_KEY} \
|
2024-11-17 23:49:02 +00:00
|
|
|
HuggingFace_API_KEY=${HuggingFace_API_KEY} \
|
2024-10-24 18:50:45 +00:00
|
|
|
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} \
|
2024-11-23 05:20:35 +00:00
|
|
|
TOGETHER_API_KEY=${TOGETHER_API_KEY} \
|
|
|
|
TOGETHER_API_BASE_URL=${TOGETHER_API_BASE_URL} \
|
2024-11-19 07:46:51 +00:00
|
|
|
VITE_LOG_LEVEL=${VITE_LOG_LEVEL} \
|
|
|
|
DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX}
|
2024-10-24 18:50:45 +00:00
|
|
|
|
2024-10-24 18:48:05 +00:00
|
|
|
RUN mkdir -p ${WORKDIR}/run
|
2024-10-24 18:50:45 +00:00
|
|
|
CMD pnpm run dev --host
|