diff --git a/Dockerfile b/Dockerfile index 2057700e3aabc..d81243bce69b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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="" \ @@ -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 . . @@ -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 @@ -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 @@ -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