diff --git a/.env.example b/.env.example index 99957d59..a27871f2 100644 --- a/.env.example +++ b/.env.example @@ -3,15 +3,27 @@ NODE_ENV=development # Next Auth config: # Generate a secret with `openssl rand -base64 32`, or visit https://generate-secret.vercel.app/ -NEXTAUTH_SECRET=changeme +NEXTAUTH_SECRET=*** NEXTAUTH_URL=http://localhost:3000 # Prisma DATABASE_URL=file:./db.sqlite # External APIs: -OPENAI_API_KEY=changeme +OPENAI_API_KEY=*** # Guest Mode: -//The key NEXT_PUBLIC_GUEST_KEY should be in this format: abc,qwe,123, where each comma-separated value can be used -NEXT_PUBLIC_GUEST_KEY=changeme +The key NEXT_PUBLIC_GUEST_KEY should be in this format: abc,qwe,123, where each comma-separated value can be used +NEXT_PUBLIC_GUEST_KEY=*** + +# Websearch. Fill both of these values to enable it locally +NEXT_PUBLIC_WEB_SEARCH_ENABLED=false # Disables the ability to toggle web search +SERP_API_KEY=*** # https://serper.dev/ for an API key + +# Auth providers. Required to enable sign in, in production. Development mode uses local auth. +GOOGLE_CLIENT_ID=*** +GOOGLE_CLIENT_SECRET=*** +GITHUB_CLIENT_ID=*** +GITHUB_CLIENT_SECRET=*** +DISCORD_CLIENT_SECRET=*** +DISCORD_CLIENT_ID=*** diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 2166698c..cd3378ae 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -36,10 +36,20 @@ jobs: uses: docker/build-push-action@v4 with: context: . + file: prod.Dockerfile build-args: | NEXTAUTH_URL=http://localhost:3000 - DATABASE_URL=file:../db/db.sqlite - SKIP_ENV_VALIDATION=1 + DATABASE_URL=file:./db.sqlite + OPENAI_API_KEY: ${OPENAI_API_KEY} + NEXT_PUBLIC_WEB_SEARCH_ENABLED: ${NEXT_PUBLIC_WEB_SEARCH_ENABLED} + SERP_API_KEY: ${SERP_API_KEY} + NEXT_PUBLIC_FF_AUTH_ENABLED: ${NEXT_PUBLIC_FF_AUTH_ENABLED} + GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID} + GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET} + GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID} + GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET} + DISCORD_CLIENT_ID: ${DISCORD_CLIENT_ID} + DISCORD_CLIENT_SECRET: ${DISCORD_CLIENT_SECRET} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 5d27d274..00000000 --- a/Dockerfile +++ /dev/null @@ -1,42 +0,0 @@ -# Use the official Node.js image -FROM node:19-alpine - - -RUN apk update && apk add --no-cache openssl - -# Set the working directory -WORKDIR /app - -# Copy package.json and package-lock.json to the working directory -COPY package*.json ./ - -# Copy the rest of the application code -COPY . . -COPY entrypoint.sh ./ - -# Ensure correct line endings after these files are edited by windows -RUN apk add --no-cache dos2unix\ - && dos2unix entrypoint.sh - - -# Expose the port the app will run on -EXPOSE 3000 - -# Prevent Husky errors by disabling the `prepare` script -RUN npm pkg set scripts.prepare="exit 0" - -# set npm registry -RUN npm config set registry 'https://registry.npmmirror.com/' - -# Install dependencies -RUN npm ci - - -ENTRYPOINT ["sh", "entrypoint.sh"] - -# Build the Next.js app -RUN npm run build - - -# Start the application -CMD ["npm", "start"] diff --git a/README.md b/README.md index 8a2ea7ab..6cbd0394 100644 --- a/README.md +++ b/README.md @@ -39,11 +39,13 @@ One-Click to deploy well-designed AutoGPT-Next-Web web UI on Vercel. - [ ] 5. Add support for WeChat login ## Business Version -During the period of maintaining open source projects, many friends came to consult about customizing the system. Considering that there may be more friends who have similar needs, we decided to start the internal test plan of the commercial version~ -* plan support - -User login system, billing system, charging system, etc., so that everyone can directly deploy a charged version of AutoGPT, and can directly obtain income -* way of participation - -To pre-order the commercial version and view the details of the commercial version plan, please click the link below [AutoGPT-Next-Web Business Vision](https://egqz2y6eul.feishu.cn/docx/PxoMd7LGfoobAixiuWacxRWQnNd) + +During the period of maintaining open source projects, many friends came to consult about customizing the system. Considering that there may be more friends who have similar needs, we decided to start the internal test plan of the commercial version~ + +- plan support - + User login system, billing system, charging system, etc., so that everyone can directly deploy a charged version of AutoGPT, and can directly obtain income +- way of participation - + To pre-order the commercial version and view the details of the commercial version plan, please click the link below [AutoGPT-Next-Web Business Vision](https://egqz2y6eul.feishu.cn/docx/PxoMd7LGfoobAixiuWacxRWQnNd) ## Get Started @@ -66,7 +68,7 @@ A: The project originated from AgentGPT. Our goal is to continuously provide use The easiest way to run AutoGPT-Next-Web locally is by using docker. ```bash - docker-compose -f docker-compose-local.yml up -d --remove-orphans + docker-compose -f docker-compose.dev.yml up -d --remove-orphans ``` ### Docker-Image @@ -74,7 +76,7 @@ The easiest way to run AutoGPT-Next-Web locally is by using docker. Using `docker-image` ```bash -docker-compose up -d --remove-orphans +docker-compose -f docker-compose.prod.yml up -d --remove-orphans ``` ### Local Development Setup diff --git a/dev.Dockerfile b/dev.Dockerfile new file mode 100644 index 00000000..2f169650 --- /dev/null +++ b/dev.Dockerfile @@ -0,0 +1,61 @@ +FROM node:19-alpine + +RUN apk update && apk add --no-cache openssl + +ARG NEXTAUTH_SECRET=$(openssl rand -base64 32) +ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET + +ARG DATABASE_URL +ENV DATABASE_URL=$DATABASE_URL + +ARG NEXTAUTH_SECRET= +ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET + +ARG NEXTAUTH_URL +ENV NEXTAUTH_URL=$NEXTAUTH_URL + +ARG SKIP_ENV_VALIDATION +ENV SKIP_ENV_VALIDATION=$SKIP_ENV_VALIDATION + +WORKDIR /app + + + +# Install dependencies based on the preferred package manager +COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ + +# Copy the rest of the application code +COPY . . + +# Prevent Husky errors by disabling the `prepare` script +RUN npm pkg set scripts.prepare="exit 0" + +# set npm registry +RUN npm config set registry 'https://registry.npmmirror.com/' + +RUN \ + if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ + elif [ -f package-lock.json ]; then npm ci; \ + elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i; \ + # Allow install without lockfile, so example works even without Node.js installed locally + else echo "Warning: Lockfile not found. It is recommended to commit lockfiles to version control." && yarn install; \ + fi + + + + +ENTRYPOINT ["sh", "entrypoint.sh"] + +# Next.js collects completely anonymous telemetry data about general usage. Learn more here: https://nextjs.org/telemetry +# Uncomment the following line to disable telemetry at run time +# ENV NEXT_TELEMETRY_DISABLED 1 + +# Note: Don't expose ports here, Compose will handle that for us + +# Start Next.js in development mode based on the preferred package manager +CMD \ + if [ -f yarn.lock ]; then yarn dev; \ + elif [ -f package-lock.json ]; then npm run dev; \ + elif [ -f pnpm-lock.yaml ]; then pnpm dev; \ + else yarn dev; \ + fi diff --git a/docker-compose-local.yml b/docker-compose-local.yml deleted file mode 100644 index 892e5a91..00000000 --- a/docker-compose-local.yml +++ /dev/null @@ -1,16 +0,0 @@ -version: '3' - -volumes: - db: - -services: - autogpt: - build: - context: . - container_name: autogpt - ports: - - 3000:3000 - volumes: - - db:/app/db - - .env:/app/.env - restart: unless-stopped diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 00000000..d79829e9 --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,29 @@ +version: '3' + +volumes: + db: + src: + public: + +services: + autogpt: + build: + context: . + dockerfile: dev.Dockerfile + args: + NEXTAUTH_URL: http://localhost:3000 + DATABASE_URL: file:./db.sqlite + SKIP_ENV_VALIDATION: 1 # omit this property to enable schema validation for the environment variables + container_name: autogpt + environment: + OPENAI_API_KEY: ${OPENAI_API_KEY} # openai api key + NEXT_PUBLIC_WEB_SEARCH_ENABLED: ${NEXT_PUBLIC_WEB_SEARCH_ENABLED} # enable web search + SERP_API_KEY: ${SERP_API_KEY} # serp api key + NEXT_PUBLIC_GUEST_KEY: ${NEXT_PUBLIC_GUEST_KEY} # guest key + ports: + - 3000:3000 + volumes: + - src:/app/src + - public:/app/public + - db:/app/db + restart: unless-stopped diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 00000000..3cff8614 --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,26 @@ +version: '3' + +services: + autogpt: + container_name: autogpt + image: dogtititi/autogpt-next-web:lastest + # build: + # context: . + # dockerfile: prod.Dockerfile + # args: + # NEXTAUTH_URL: http://localhost:3000 + # DATABASE_URL: file:./db.sqlite + # OPENAI_API_KEY: ${OPENAI_API_KEY} # openai api key + # NEXT_PUBLIC_WEB_SEARCH_ENABLED: ${NEXT_PUBLIC_WEB_SEARCH_ENABLED} # enable web search + # SERP_API_KEY: ${SERP_API_KEY} # serp api key + # NEXT_PUBLIC_GUEST_KEY: ${NEXT_PUBLIC_GUEST_KEY} # guest key + # NEXT_PUBLIC_FF_AUTH_ENABLED: ${NEXT_PUBLIC_FF_AUTH_ENABLED} # auth enable + # GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID} # google client id + # GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET} # google client secret + # GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID} # github client id + # GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET} # github client secret + # DISCORD_CLIENT_ID: ${DISCORD_CLIENT_ID} # discord client id + # DISCORD_CLIENT_SECRET: ${DISCORD_CLIENT_SECRET} # discord client secret + ports: + - 3000:3000 + restart: unless-stopped diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 4052fcd8..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,15 +0,0 @@ -version: '3' - -volumes: - db: - -services: - autogpt: - image: dogtititi/autogpt-next-web:latest - container_name: autogpt - ports: - - 3000:3000 - volumes: - - db:/app/db - - .env:/app/.env - restart: unless-stopped diff --git a/docs/README_CN.md b/docs/README_CN.md index 3d294f02..9c6bdc19 100644 --- a/docs/README_CN.md +++ b/docs/README_CN.md @@ -39,11 +39,13 @@ One-Click to deploy well-designed AutoGPT-Next-Web web UI on Vercel. - [ ] 5. 增加微信登录支持 ## 商业愿景 + 在维护开源项目的期间,很多朋友前来咨询关于定制系统的事宜。考虑到可能有更多有类似需求的朋友,我们决定启动商业版本的内部测试计划 -* 计划支持 - -用户登录系统、计费系统、收费系统等,使每个人都可以直接部署一个收费版本的AutoGPT,并直接获得收入。 -* 参与方式 - -要预定商业版并查看商业版计划的详情,请单击下面的链接[AutoGPT-Next-Web商业愿景](https://egqz2y6eul.feishu.cn/docx/PxoMd7LGfoobAixiuWacxRWQnNd)。 + +- 计划支持 - + 用户登录系统、计费系统、收费系统等,使每个人都可以直接部署一个收费版本的 AutoGPT,并直接获得收入。 +- 参与方式 - + 要预定商业版并查看商业版计划的详情,请单击下面的链接[AutoGPT-Next-Web 商业愿景](https://egqz2y6eul.feishu.cn/docx/PxoMd7LGfoobAixiuWacxRWQnNd)。 ## 常见问题 @@ -66,7 +68,7 @@ A:项目源自于 AgentGPT,我们目标是持续输出对国内用户友好 使用 Docker 是在本地运行 AutoGPT-Next-Web 最简单的方法。 ```bash -docker-compose -f docker-compose-local.yml up -d --remove-orphans +docker-compose -f docker-compose.dev.yml up -d --remove-orphans ``` ### Docker-Image @@ -74,7 +76,7 @@ docker-compose -f docker-compose-local.yml up -d --remove-orphans 使用 `docker-image` 部署 ```bash -docker-compose up -d --remove-orphans +docker-compose -f docker-compose.prod.yml up -d --remove-orphans ``` ### 本地开发环境配置 diff --git a/docs/README_JA.md b/docs/README_JA.md index 8b343e49..2f5f6b22 100644 --- a/docs/README_JA.md +++ b/docs/README_JA.md @@ -24,7 +24,7 @@ ## 特徴 -1. Vercel を使ったワンクリックの無料デプロイメントが1分で完了 +1. Vercel を使ったワンクリックの無料デプロイメントが 1 分で完了 2. 現地での対応力を向上させました: 中国語で入力すると、英語ではなく中国語で内容が表示 3. AgentGPT に合わせた UI 設計、レスポンシブデザイン、ダークモードへの対応 4. 独自ドメインをお持ちですか?バインド後、障壁なくどこでもすぐにアクセスできるのがさらに良い @@ -39,11 +39,13 @@ - [ ] 5. WeChat のログインに対応 ## ビジネスバージョン + オープンソースプロジェクトを維持する期間中、多くの友人がシステムのカスタマイズについて相談に来ました。類似のニーズを持つ友人がより多くいる可能性があることを考慮して、商用版の内部テスト計画を開始することにしました〜 -* 計画サポート - -ユーザーログインシステム、請求システム、課金システムなどをサポートし、誰でも直接有料版のAutoGPTを展開し、収入を直接獲得することができます。 -* 参加方法 - -商業版を事前予約し、商業版計画の詳細を見るには、以下のリンク[AutoGPT-Next-Webビジネスビジョン](https://egqz2y6eul.feishu.cn/docx/PxoMd7LGfoobAixiuWacxRWQnNd)。 + +- 計画サポート - + ユーザーログインシステム、請求システム、課金システムなどをサポートし、誰でも直接有料版の AutoGPT を展開し、収入を直接獲得することができます。 +- 参加方法 - + 商業版を事前予約し、商業版計画の詳細を見るには、以下のリンク[AutoGPT-Next-Web ビジネスビジョン](https://egqz2y6eul.feishu.cn/docx/PxoMd7LGfoobAixiuWacxRWQnNd)。 ## はじめに @@ -67,15 +69,15 @@ AutoGPT-Next-Web をローカルで実行する最も簡単な方法は、docker 便利なセットアップスクリプトが提供されているので、ぜひお試しください。 ```bash -./setup.sh --docker +docker-compose -f docker-compose.dev.yml up -d --remove-orphans ``` -### Docker-compose +### Docker-Image -`docker-compose` デプロイを使用 +`docker-image` デプロイを使用 ```bash -./setup.sh --docker-compose +docker-compose -f docker-compose.prod.yml up -d --remove-orphans ``` ### ローカル開発セットアップ @@ -126,7 +128,7 @@ DATABASE_URL=file:./db.sqlite OPENAI_API_KEY='' ``` -5. sqliteを使用するためにprismaスキーマを変更: +5. sqlite を使用するために prisma スキーマを変更: ```bash ./prisma/useSqlite.sh diff --git a/entrypoint.sh b/entrypoint.sh index 4e99f4b6..8c990475 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,14 +1,5 @@ #!/bin/env sh -# copy .env file if not exists -[ ! -f .env ] && [ -f .env.example ] && cp .env.example .env -cp .env .env.temp -dos2unix .env.temp -cat .env.temp > .env -rm .env.temp - -source .env - # change schema.prisma sed -ie 's/mysql/sqlite/g' prisma/schema.prisma sed -ie 's/@db.Text//' prisma/schema.prisma diff --git a/next.config.mjs b/next.config.mjs index fb201b26..f205ce6e 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -17,5 +17,6 @@ const config = { config.experiments = { asyncWebAssembly: true, layers: true }; return config; }, + output: "standalone", }; export default config; diff --git a/prod.Dockerfile b/prod.Dockerfile new file mode 100644 index 00000000..641f932b --- /dev/null +++ b/prod.Dockerfile @@ -0,0 +1,164 @@ +FROM node:19-alpine AS base + +# Step 1. Rebuild the source code only when needed +FROM base AS builder + +RUN apk update && apk add --no-cache openssl + +WORKDIR /app + +# Install dependencies based on the preferred package manager +COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ + + +# Prevent Husky errors by disabling the `prepare` script +RUN npm pkg set scripts.prepare="exit 0" + +# set npm registry +RUN npm config set registry 'https://registry.npmmirror.com/' + +# Omit --production flag for TypeScript devDependencies +RUN \ + if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ + elif [ -f package-lock.json ]; then npm ci; \ + elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i; \ + # Allow install without lockfile, so example works even without Node.js installed locally + else echo "Warning: Lockfile not found. It is recommended to commit lockfiles to version control." && yarn install; \ + fi + +# Copy the rest of the application code +COPY . . + +# Environment variables must be present at build time +# https://github.com/vercel/next.js/discussions/14030 + +ARG NEXTAUTH_SECRET +ENV NEXTAUTH_SECRET=${NEXTAUTH_SECRET:-"$(openssl rand -base64 32)"} + + +ARG DATABASE_URL +ENV DATABASE_URL=$DATABASE_URL + + +ARG NEXTAUTH_URL +ENV NEXTAUTH_URL=$NEXTAUTH_URL + +ARG OPENAI_API_KEY +ENV OPENAI_API_KEY=$OPENAI_API_KEY + +ARG NEXT_PUBLIC_WEB_SEARCH_ENABLED +ENV NEXT_PUBLIC_WEB_SEARCH_ENABLED=$NEXT_PUBLIC_WEB_SEARCH_ENABLED + +ARG SERP_API_KEY +ENV SERP_API_KEY=$SERP_API_KEY + +ARG NEXT_PUBLIC_GUEST_KEY +ENV NEXT_PUBLIC_GUEST_KEY=$NEXT_PUBLIC_GUEST_KEY + +ARG NEXT_PUBLIC_FF_AUTH_ENABLED +ENV NEXT_PUBLIC_FF_AUTH_ENABLED=$NEXT_PUBLIC_FF_AUTH_ENABLED + +ARG GOOGLE_CLIENT_ID +ENV GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID + +ARG GOOGLE_CLIENT_SECRET +ENV GOOGLE_CLIENT_SECRET=$GOOGLE_CLIENT_SECRET + +ARG GITHUB_CLIENT_ID +ENV GITHUB_CLIENT_ID=$GITHUB_CLIENT_ID + +ARG GITHUB_CLIENT_SECRET +ENV GITHUB_CLIENT_SECRET=$GITHUB_CLIENT_SECRET + +ARG DISCORD_CLIENT_ID +ENV DISCORD_CLIENT_ID=$DISCORD_CLIENT_ID + +# Next.js collects completely anonymous telemetry data about general usage. Learn more here: https://nextjs.org/telemetry +# Uncomment the following line to disable telemetry at build time +# ENV NEXT_TELEMETRY_DISABLED 1 + + +# Build Next.js based on the preferred package manager +RUN \ + if [ -f yarn.lock ]; then yarn build; \ + elif [ -f package-lock.json ]; then npm run build; \ + elif [ -f pnpm-lock.yaml ]; then pnpm build; \ + else yarn build; \ + fi + +# Note: It is not necessary to add an intermediate step that does a full copy of `node_modules` here + +# Step 2. Production image, copy all the files and run next +FROM base AS runner + +WORKDIR /app + +# Don't run production as root +RUN addgroup --system --gid 1001 nodejs +RUN adduser --system --uid 1001 nextjs +USER nextjs + +COPY --from=builder /app/public ./public +COPY --from=builder /app/entrypoint.sh ./ +COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma + + + +# Automatically leverage output traces to reduce image size +# https://nextjs.org/docs/advanced-features/output-file-tracing +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static + +# Environment variables must be redefined at run time + +ARG NEXTAUTH_SECRET +ENV NEXTAUTH_SECRET=${NEXTAUTH_SECRET:-"$(openssl rand -base64 32)"} + + + +ARG DATABASE_URL +ENV DATABASE_URL=$DATABASE_URL + + +ARG NEXTAUTH_URL +ENV NEXTAUTH_URL=$NEXTAUTH_URL + + +ARG OPENAI_API_KEY +ENV OPENAI_API_KEY=$OPENAI_API_KEY + +ARG NEXT_PUBLIC_WEB_SEARCH_ENABLED +ENV NEXT_PUBLIC_WEB_SEARCH_ENABLED=$NEXT_PUBLIC_WEB_SEARCH_ENABLED + +ARG SERP_API_KEY +ENV SERP_API_KEY=$SERP_API_KEY + +ARG NEXT_PUBLIC_GUEST_KEY +ENV NEXT_PUBLIC_GUEST_KEY=$NEXT_PUBLIC_GUEST_KEY + +ARG NEXT_PUBLIC_FF_AUTH_ENABLED +ENV NEXT_PUBLIC_FF_AUTH_ENABLED=$NEXT_PUBLIC_FF_AUTH_ENABLED + +ARG GOOGLE_CLIENT_ID +ENV GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID + +ARG GOOGLE_CLIENT_SECRET +ENV GOOGLE_CLIENT_SECRET=$GOOGLE_CLIENT_SECRET + +ARG GITHUB_CLIENT_ID +ENV GITHUB_CLIENT_ID=$GITHUB_CLIENT_ID + +ARG GITHUB_CLIENT_SECRET +ENV GITHUB_CLIENT_SECRET=$GITHUB_CLIENT_SECRET + +ARG DISCORD_CLIENT_ID +ENV DISCORD_CLIENT_ID=$DISCORD_CLIENT_ID + +# Uncomment the following line to disable telemetry at run time +# ENV NEXT_TELEMETRY_DISABLED 1 + +# Note: Don't expose ports here, Compose will handle that for us + +ENTRYPOINT ["sh", "entrypoint.sh"] + +CMD ["node", "server.js"] diff --git a/setup.sh b/setup.sh index e13c8298..dd530209 100755 --- a/setup.sh +++ b/setup.sh @@ -83,16 +83,9 @@ SERP_API_KEY=$SERP_API_KEY\n\ NEXT_PUBLIC_WEB_SEARCH_ENABLED=$NEXT_PUBLIC_WEB_SEARCH_ENABLED\n" - - printf $ENV > .env -if [ "$1" = "--docker-compose-local" ]; then - docker-compose -f docker-compose-local.yml up -d --remove-orphans -elif [ "$1" = "--docker-compose" ]; then - docker-compose up -d --remove-orphans -else - ./prisma/useSqlite.sh - npm install - npm run dev -fi +./prisma/useSqlite.sh +npm install +npx prisma db push +npm run dev diff --git a/src/env/schema.mjs b/src/env/schema.mjs index 6169c301..5f239295 100644 --- a/src/env/schema.mjs +++ b/src/env/schema.mjs @@ -9,7 +9,7 @@ const isProdutionAndAuthEnabled = const requiredAuthEnabledForProduction = () => { return isProdutionAndAuthEnabled ? z.string().min(1).trim() - : z.string().min(1).trim().optional(); + : z.string().optional(); }; const stringToBoolean = () => {