From f79327cd25ded50d426e55187a9899440d4bdf76 Mon Sep 17 00:00:00 2001 From: Mackie Date: Fri, 22 May 2026 22:43:51 +0800 Subject: [PATCH] env --- .env.example | 8 ++++---- Dockerfile | 10 +++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.env.example b/.env.example index 5165c75..c0e5b2a 100644 --- a/.env.example +++ b/.env.example @@ -1,11 +1,11 @@ # Database connection string -DATABASE_URL=mongodb://127.0.0.1/your-database-name +DATABASE_URI=mongodb://127.0.0.1/your-database-name # Or use a PG connection string -#DATABASE_URL=postgresql://127.0.0.1:5432/your-database-name +#DATABASE_URI=postgresql://127.0.0.1:5432/your-database-name # Used to encrypt JWT tokens -PAYLOAD_SECRET=983ce713fd91f87296aab092dd4748c78ac5f69fa410f4ee2d4a0c4655a48063 +PAYLOAD_SECRET=YOUR_PAYLOAD_SECRET_HERE # Used to configure CORS, format links and more. No trailing slash NEXT_PUBLIC_SERVER_URL=http://localhost:3002 @@ -14,4 +14,4 @@ NEXT_PUBLIC_SERVER_URL=http://localhost:3002 CRON_SECRET=YOUR_CRON_SECRET_HERE # Used to validate preview requests -PREVIEW_SECRET=YOUR_SECRET_HERE +PREVIEW_SECRET=YOUR_PREVIEW_SECRET_HERE diff --git a/Dockerfile b/Dockerfile index 73f0f7d..3e64871 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,11 +14,15 @@ COPY --from=deps /app/node_modules ./node_modules COPY . . ENV NEXT_TELEMETRY_DISABLED=1 -ENV DATABASE_URI=mongodb://mongo:databasemultisite@portfolio-database-tkom3p:27017/?authSource=admin&directConnection=true -ENV PAYLOAD_SECRET=983ce713fd91f87296aab092dd4748c78ac5f69fa410f4ee2d4a0c4655a48063 -ENV NEXT_PUBLIC_SERVER_URL=https://bymackie.com ENV NODE_ENV=production +ARG DATABASE_URI +ARG PAYLOAD_SECRET +ARG NEXT_PUBLIC_SERVER_URL +ENV DATABASE_URI=$DATABASE_URI +ENV PAYLOAD_SECRET=$PAYLOAD_SECRET +ENV NEXT_PUBLIC_SERVER_URL=$NEXT_PUBLIC_SERVER_URL + RUN pnpm payload generate:types || echo "Skipped" RUN pnpm next build --experimental-build-mode compile