Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
LovelyGuYiMeng authored Oct 5, 2024
1 parent 0c32283 commit be00329
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ FROM base AS builder

ARG USE_CN_MIRROR

ENV NEXT_PUBLIC_BASE_PATH=""
ENV NEXT_PUBLIC_SERVICE_MODE="server" \
APP_URL="http://app.com" \
DATABASE_DRIVER="node" \
DATABASE_URL="postgres://postgres:password@localhost:5432/postgres" \
KEY_VAULTS_SECRET="use-for-build"

# Sentry
ENV NEXT_PUBLIC_SENTRY_DSN="" \
Expand Down Expand Up @@ -74,9 +78,9 @@ RUN \
&& corepack use pnpm \
# Install the dependencies
&& pnpm i \
# Add sharp dependencies
# Add sharp and db migration dependencies
&& mkdir -p /deps \
&& pnpm add sharp --prefix /deps
&& pnpm add sharp pg drizzle-orm --prefix /deps

COPY . .

Expand All @@ -94,7 +98,16 @@ COPY --from=builder /app/public /app/public
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder /app/.next/standalone /app/
COPY --from=builder /app/.next/static /app/.next/static

# copy dependencies
COPY --from=builder /deps/node_modules/.pnpm /app/node_modules/.pnpm
COPY --from=builder /deps/node_modules/pg /app/node_modules/pg
COPY --from=builder /deps/node_modules/drizzle-orm /app/node_modules/drizzle-orm

# Copy database migrations
COPY --from=builder /app/src/database/server/migrations /app/migrations
COPY --from=builder /app/scripts/migrateServerDB/docker.cjs /app/docker.cjs
COPY --from=builder /app/scripts/migrateServerDB/errorHint.js /app/errorHint.js

# Copy server launcher
COPY --from=builder /app/scripts/serverLauncher/startServer.js /app/startServer.js
Expand Down Expand Up @@ -124,12 +137,31 @@ ENV HOSTNAME="0.0.0.0" \

# General Variables
ENV ACCESS_CODE="" \
APP_URL="" \
API_KEY_SELECT_MODE="" \
DEFAULT_AGENT_CONFIG="" \
SYSTEM_AGENT="" \
FEATURE_FLAGS="" \
PROXY_URL=""

# Database
ENV KEY_VAULTS_SECRET="" \
DATABASE_DRIVER="node" \
DATABASE_URL=""

# Next Auth
ENV NEXT_AUTH_SECRET="" \
NEXT_AUTH_SSO_PROVIDERS="" \
NEXTAUTH_URL=""

# S3
ENV NEXT_PUBLIC_S3_DOMAIN="" \
S3_PUBLIC_DOMAIN="" \
S3_ACCESS_KEY_ID="" \
S3_BUCKET="" \
S3_ENDPOINT="" \
S3_SECRET_ACCESS_KEY=""

# Model Variables
ENV \
# AI21
Expand Down Expand Up @@ -191,7 +223,7 @@ ENV \
# 01.AI
ZEROONE_API_KEY="" ZEROONE_MODEL_LIST="" \
# Zhipu
ZHIPU_API_KEY="" ZHIPU_MODEL_LIST=""
ZHIPU_API_KEY=""

USER nextjs

Expand Down

0 comments on commit be00329

Please sign in to comment.