From 77914672e022c94a5780b6b4d26e25b1c76d8dbf Mon Sep 17 00:00:00 2001 From: kurihada Date: Wed, 25 Feb 2026 14:30:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B3=A8=E5=85=A5=E9=AB=98=E5=BE=B7?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=20API=20Key=20=E5=88=B0=20Docker=20=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E5=92=8C=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 ++ Jenkinsfile | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a8bd167..cfb6496 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,8 @@ FROM base AS builder WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . +ARG NEXT_PUBLIC_AMAP_API_KEY +ENV NEXT_PUBLIC_AMAP_API_KEY=${NEXT_PUBLIC_AMAP_API_KEY} RUN npx prisma generate ENV DATABASE_URL="file:./template.db" RUN npx prisma db push diff --git a/Jenkinsfile b/Jenkinsfile index 6ed5d70..149eb9c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,8 @@ pipeline { agent any environment { - APP_NAME = 'no-whatever' + APP_NAME = 'no-whatever' + AMAP_KEY = '7f6be40a6de3f7fbb7bc3f825b67573b' } triggers { @@ -18,7 +19,7 @@ pipeline { stage('Build Docker Image') { steps { - sh "docker build -t ${APP_NAME}:${BUILD_NUMBER} -t ${APP_NAME}:latest ." + sh "docker build --build-arg NEXT_PUBLIC_AMAP_API_KEY=${AMAP_KEY} -t ${APP_NAME}:${BUILD_NUMBER} -t ${APP_NAME}:latest ." } } @@ -34,6 +35,7 @@ pipeline { -p 3000:3000 \ -v /data/${APP_NAME}:/app/data \ -e DATABASE_URL=file:/app/data/prod.db \ + -e AMAP_API_KEY=${AMAP_KEY} \ --restart unless-stopped \ ${APP_NAME}:latest """