From 674de75bff84f9c0731edec705fdbf0b4773c13e Mon Sep 17 00:00:00 2001 From: hex2077 Date: Tue, 26 Aug 2025 22:02:34 +0800 Subject: [PATCH] =?UTF-8?q?refactor(docker):=20=E7=A7=BB=E9=99=A4=E5=AF=B9?= =?UTF-8?q?.env=E6=96=87=E4=BB=B6=E7=9A=84=E6=8C=82=E8=BD=BD=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新docker-compose.yml和文档,不再需要挂载.env文件 --- DOCKER_USAGE.md | 4 +--- docker-compose.yml | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/DOCKER_USAGE.md b/DOCKER_USAGE.md index fd9ea0a..bd086ad 100644 --- a/DOCKER_USAGE.md +++ b/DOCKER_USAGE.md @@ -39,7 +39,7 @@ docker build -t podcast-server -f Dockerfile-Server . #### 运行 Web 应用容器 ```bash -docker run -d -p 3200:3000 -v /opt/audio:/app/server/output -v /opt/sqlite.db:/app/web/sqlite.db -v /opt/audio/.env:/app/web/.env -v /opt/audio/config:/app/config --restart always --name podcast-web podcast-web +docker run -d -p 3200:3000 -v /opt/audio:/app/server/output -v /opt/sqlite.db:/app/web/sqlite.db -v /opt/audio/config:/app/config --restart always --name podcast-web podcast-web ``` #### 命令说明: @@ -48,7 +48,6 @@ docker run -d -p 3200:3000 -v /opt/audio:/app/server/output -v /opt/sqlite.db:/a * `-p 3200:3000`:将宿主机的 3200 端口映射到容器的 3000 端口。Next.js 应用程序在容器内部的 3000 端口上运行。 * `-v /opt/audio:/app/server/output`:将宿主机的 `/opt/audio` 目录挂载到容器内的 `/app/server/output` 目录,用于音频文件的持久化存储。 * `-v /opt/sqlite.db:/app/web/sqlite.db`:将宿主机的 `/opt/sqlite.db` 文件挂载到容器内的 `/app/web/sqlite.db` 文件,用于数据库的持久化存储。 -* `-v /opt/audio/.env:/app/web/.env`:将宿主机的 `/opt/audio/.env` 文件挂载到容器内的 `/app/web/.env` 文件,用于配置环境变量。 * `-v /opt/audio/config:/app/config`:将宿主机的 `/opt/audio/config` 目录挂载到容器内的 `/app/config` 目录,用于配置文件的持久化存储。 * `--restart always`:设置容器的重启策略,确保容器在意外停止或系统重启后能自动重启。 * `--name podcast-web`:为运行中的容器指定一个名称,方便后续管理。 @@ -84,7 +83,6 @@ Docker Compose 文件中定义了以下挂载点: * `/opt/audio/output:/app/server/output`:将宿主机的 `/opt/audio/output` 目录挂载到容器内的 `/app/server/output` 目录,用于音频文件的持久化存储。 * `/opt/audio/sqlite.db:/app/web/sqlite.db`:将宿主机的 `/opt/audio/sqlite.db` 文件挂载到容器内的 `/app/web/sqlite.db` 文件,用于数据库的持久化存储。 -* `/opt/audio/.env:/app/web/.env`:将宿主机的 `/opt/audio/.env` 文件挂载到容器内的 `/app/web/.env` 文件,用于配置环境变量。 * `/opt/audio/config:/app/config`:将宿主机的 `/opt/audio/config` 目录挂载到容器内的 `/app/config` 目录,用于配置文件的持久化存储。 ### 启动服务 diff --git a/docker-compose.yml b/docker-compose.yml index 321c0f9..81097a5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,6 @@ services: volumes: - /opt/audio/output:/app/server/output - /opt/audio/sqlite.db:/app/web/sqlite.db - - /opt/audio/.env:/app/web/.env - /opt/audio/config:/app/config restart: always container_name: podcast-web