diff --git a/Dockerfile b/Dockerfile index 1d2389d..7bb5ca0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -413,15 +413,14 @@ COPY --from=s3final migrations /supabase/storage-api/migrations # # 拷贝依赖声明并安装仅生产依赖 COPY chatbot-ui/package.json chatbot-ui/package-lock.json supabase/chatai-ui/ WORKDIR /supabase/chatai-ui -#RUN npm ci --omit=dev RUN npm ci # 拷贝构建产物和依赖 COPY --from=chataibuilder /app/.next ./.next COPY --from=chataibuilder /app/public ./public -#COPY --from=chataibuilder /app/node_modules supabase/chatai-ui/node_modules COPY --from=chataibuilder /app/next.config.js ./next.config.js COPY chatbot-ui/.env.local ./.env.local +COPY chatbot-ui/supabase ./supabase WORKDIR / ENV NODE_ENV=production diff --git a/supabase/chatai-ui/init.sh b/supabase/chatai-ui/init.sh new file mode 100644 index 0000000..96dd86f --- /dev/null +++ b/supabase/chatai-ui/init.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +export PGUSER=supabase_admin +export PGPASSWORD=postgres +export PGHOST=127.0.0.1 +export PGPORT=5432 +export PGDATABASE=postgres + +echo "Running migrations..." + +for file in $(ls /supabase/migrations/*.sql | sort); do + echo "Executing $file" + psql -f "$file" +done + +echo "Running seed.sql..." +psql -f /supabase/seed.sql + +echo "All SQL scripts executed successfully."