初次提交
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
## Docker Compose 配置文件说明
|
||||
|
||||
### 配置矩阵
|
||||
|
||||
根据镜像构建方式与缓存依赖需求,配置文件分类如下:
|
||||
|
||||
| 部署场景 \ 镜像来源 | 本地构建 | GitHub 官方预构建 | GitHub 官方(南京大学镜像加速) |
|
||||
| :--------------------: | :------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------: |
|
||||
| **标准版(无 Redis)** | [docker-compose.yml](/docker-compose/docker-compose.yml) | [docker-compose-prebuild-github.yml](/docker-compose/docker-compose-prebuild-github.yml) | [docker-compose-prebuild-nju.yml](/docker-compose/docker-compose-prebuild-nju.yml) |
|
||||
| **含 Redis(不推荐)** | [docker-compose-redis.yml](/docker-compose/docker-compose-redis.yml) | [docker-compose-prebuild-github-redis.yml](/docker-compose/docker-compose-prebuild-github-redis.yml) | [docker-compose-prebuild-nju-redis.yml](/docker-compose/docker-compose-prebuild-nju-redis.yml) |
|
||||
|
||||
### 版本选择建议
|
||||
|
||||
VoiceHub 提供三类主要部署方案,请根据实际环境选择:
|
||||
|
||||
**1. 国内个人用户(推荐)**
|
||||
建议优先选用 `docker-compose-prebuild-nju.yml`。该配置使用南京大学镜像站加速拉取,可有效改善国内网络环境下的镜像下载体验。
|
||||
|
||||
**2. 企业/云服务器部署**
|
||||
若您使用具备良好国际出口带宽的国内云服务商(如阿里云、腾讯云等),建议选用 `docker-compose-prebuild-github.yml`,直接拉取 GitHub 官方预构建镜像。
|
||||
|
||||
**3. 自定义构建需求**
|
||||
如需修改源码、调整依赖或适配私有网络环境,请选用 `docker-compose.yml` 并在本地执行镜像构建。您可根据需要修改 `Dockerfile` 以适配国内软件源等特定环境。
|
||||
|
||||
### ⚠️ 关于 Redis 版本的特别提示
|
||||
|
||||
当前 Redis 版本存在稳定性问题,**强烈建议避免使用**。如确有缓存需求,请选用带 `-redis` 后缀的配置文件,但需注意相关风险。
|
||||
@@ -0,0 +1,44 @@
|
||||
services:
|
||||
voicehub:
|
||||
image: ghcr.io/laoshuikaixue/voicehub:latest
|
||||
ports:
|
||||
- '3000:3000'
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://user:password@postgres:5432/voicehub
|
||||
- JWT_SECRET=your-jwt-secret-here
|
||||
- NODE_ENV=production
|
||||
- REDIS_URL=redis://default:your-redis-password-here@redis:6379
|
||||
depends_on:
|
||||
- postgres
|
||||
volumes:
|
||||
- .:/app
|
||||
- /app/node_modules
|
||||
restart: unless-stopped
|
||||
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
environment:
|
||||
- POSTGRES_USER=user
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=voicehub
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- '5432:5432'
|
||||
restart: unless-stopped
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
command: >
|
||||
redis-server
|
||||
--requirepass your-redis-password-here
|
||||
--appendonly yes
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
ports:
|
||||
- '6379:6379'
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
@@ -0,0 +1,30 @@
|
||||
services:
|
||||
voicehub:
|
||||
image: ghcr.io/laoshuikaixue/voicehub:latest
|
||||
ports:
|
||||
- '3000:3000'
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://user:password@postgres:5432/voicehub
|
||||
- JWT_SECRET=your-jwt-secret-here
|
||||
- NODE_ENV=production
|
||||
depends_on:
|
||||
- postgres
|
||||
volumes:
|
||||
- .:/app
|
||||
- /app/node_modules
|
||||
restart: unless-stopped
|
||||
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
environment:
|
||||
- POSTGRES_USER=user
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=voicehub
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- '5432:5432'
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
@@ -0,0 +1,44 @@
|
||||
services:
|
||||
voicehub:
|
||||
image: ghcr.nju.edu.cn/laoshuikaixue/voicehub:latest
|
||||
ports:
|
||||
- '3000:3000'
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://user:password@postgres:5432/voicehub
|
||||
- JWT_SECRET=your-jwt-secret-here
|
||||
- NODE_ENV=production
|
||||
- REDIS_URL=redis://default:your-redis-password-here@redis:6379
|
||||
depends_on:
|
||||
- postgres
|
||||
volumes:
|
||||
- .:/app
|
||||
- /app/node_modules
|
||||
restart: unless-stopped
|
||||
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
environment:
|
||||
- POSTGRES_USER=user
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=voicehub
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- '5432:5432'
|
||||
restart: unless-stopped
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
command: >
|
||||
redis-server
|
||||
--requirepass your-redis-password-here
|
||||
--appendonly yes
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
ports:
|
||||
- '6379:6379'
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
@@ -0,0 +1,31 @@
|
||||
services:
|
||||
voicehub:
|
||||
container_name: voicehub
|
||||
image: ghcr.nju.edu.cn/laoshuikaixue/voicehub:latest
|
||||
ports:
|
||||
- '3000:3000'
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://user:password@postgres:5432/voicehub
|
||||
- JWT_SECRET=your-jwt-secret-here
|
||||
- NODE_ENV=production
|
||||
depends_on:
|
||||
- postgres
|
||||
volumes:
|
||||
- .:/app
|
||||
- /app/node_modules
|
||||
restart: unless-stopped
|
||||
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
environment:
|
||||
- POSTGRES_USER=user
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=voicehub
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- '5432:5432'
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
@@ -0,0 +1,44 @@
|
||||
services:
|
||||
voicehub:
|
||||
build: .
|
||||
ports:
|
||||
- '3000:3000'
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://user:password@postgres:5432/voicehub
|
||||
- JWT_SECRET=your-jwt-secret-here
|
||||
- NODE_ENV=production
|
||||
- REDIS_URL=redis://default:your-redis-password-here@redis:6379
|
||||
depends_on:
|
||||
- postgres
|
||||
volumes:
|
||||
- .:/app
|
||||
- /app/node_modules
|
||||
restart: unless-stopped
|
||||
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
environment:
|
||||
- POSTGRES_USER=user
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=voicehub
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- '5432:5432'
|
||||
restart: unless-stopped
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
command: >
|
||||
redis-server
|
||||
--requirepass your-redis-password-here
|
||||
--appendonly yes
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
ports:
|
||||
- '6379:6379'
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
@@ -0,0 +1,30 @@
|
||||
services:
|
||||
voicehub:
|
||||
build: .
|
||||
ports:
|
||||
- '3000:3000'
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://user:password@postgres:5432/voicehub
|
||||
- JWT_SECRET=your-jwt-secret-here
|
||||
- NODE_ENV=production
|
||||
depends_on:
|
||||
- postgres
|
||||
volumes:
|
||||
- .:/app
|
||||
- /app/node_modules
|
||||
restart: unless-stopped
|
||||
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
environment:
|
||||
- POSTGRES_USER=user
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=voicehub
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- '5432:5432'
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
Reference in New Issue
Block a user