From 7b610ef8cd7c66f5535e5f82ec4f7f8c810c333a Mon Sep 17 00:00:00 2001 From: imsyy Date: Tue, 5 Nov 2024 16:07:09 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20chore:=20=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env => .env.example | 0 .gitignore | 1 + Dockerfile | 5 ++++- README.md | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) rename .env => .env.example (100%) diff --git a/.env b/.env.example similarity index 100% rename from .env rename to .env.example diff --git a/.gitignore b/.gitignore index a307e94f..74de06a2 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ node_modules .DS_Store dist *.local +.env # Editor directories and files .vscode/* diff --git a/Dockerfile b/Dockerfile index 399739b1..cf36fe8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,10 +15,13 @@ FROM base AS builder RUN npm install -g pnpm WORKDIR /app -COPY package*json tsconfig.json pnpm-lock.yaml .env ./ +COPY package*json tsconfig.json pnpm-lock.yaml .env.example ./ COPY src ./src COPY public ./public +# add .env.example to .env +RUN [ ! -e ".env" ] && cp .env.example .env || true + RUN pnpm install RUN pnpm build RUN pnpm prune --production diff --git a/README.md b/README.md index b8d910fb..edc94f51 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,8 @@ cd DailyHotApi npm install ``` +复制 `/.env.example` 文件并重命名为 `/.env` 并修改配置 + #### 开发 ```bash