From 907b47cbcda4fe0371a043100e367fa1ea3ba429 Mon Sep 17 00:00:00 2001 From: "raoha.rh" Date: Tue, 2 Jul 2024 16:33:01 +0800 Subject: [PATCH] fix: local setup --- docker/Dockerfile.vercel | 3 ++- server/.env.example | 2 ++ server/main.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile.vercel b/docker/Dockerfile.vercel index f4ec5ca9..5a0eb5d8 100644 --- a/docker/Dockerfile.vercel +++ b/docker/Dockerfile.vercel @@ -27,7 +27,7 @@ COPY ./client . # Uncomment the following line in case you want to disable telemetry during the build. # ENV NEXT_TELEMETRY_DISABLED 1 -ENV NEXT_PUBLIC_API_DOMAIN ${NEXT_PUBLIC_API_DOMAIN} +ENV NEXT_STANDALONE true RUN ls RUN \ @@ -64,6 +64,7 @@ USER nextjs EXPOSE 3000 ENV PORT 3000 +ENV NEXT_PUBLIC_API_DOMAIN ${NEXT_PUBLIC_API_DOMAIN} # server.js is created by next build from the standalone output # https://nextjs.org/docs/pages/api-reference/next-config-js/output diff --git a/server/.env.example b/server/.env.example index d52ab30e..b2212aab 100644 --- a/server/.env.example +++ b/server/.env.example @@ -2,6 +2,8 @@ SUPABASE_URL=supabase_url SUPABASE_SERVICE_KEY=supabase_service_key +CORS_ORIGIN_WHITELIST=localhost:3000 + # OPTIONAL - Github Apps Configures X_GITHUB_APP_ID=github_app_id X_GITHUB_APPS_CLIENT_ID=github_apps_client_id diff --git a/server/main.py b/server/main.py index 643435d7..245eaf5b 100644 --- a/server/main.py +++ b/server/main.py @@ -31,7 +31,7 @@ secret_key = session_secret_key, ) -cors_origins = ["*"] + cors_origins_whitelist.split(',') +cors_origins = ["http://0.0.0.0:3000", "http://localhost:3000"] + cors_origins_whitelist.split(',') app.add_middleware( CORSMiddleware,