Skip to content

Commit 796a913

Browse files
Update docker-compose.yml
1 parent c16fe06 commit 796a913

1 file changed

Lines changed: 11 additions & 48 deletions

File tree

docker-compose.yml

Lines changed: 11 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,26 @@
1-
# New-API Docker Compose Configuration
2-
#
3-
# Quick Start:
4-
# 1. docker-compose up -d
5-
# 2. Access at http://localhost:3000
6-
#
7-
# Using MySQL instead of PostgreSQL:
8-
# 1. Comment out the postgres service and SQL_DSN line 15
9-
# 2. Uncomment the mysql service and SQL_DSN line 16
10-
# 3. Uncomment mysql in depends_on (line 28)
11-
# 4. Uncomment mysql_data in volumes section (line 64)
12-
#
13-
# ⚠️ IMPORTANT: Change all default passwords before deploying to production!
14-
15-
version: '3.4' # For compatibility with older Docker versions
1+
version: '3.4'
162

173
services:
18-
new-api:
19-
image: calciumion/new-api:latest
20-
container_name: new-api
4+
nebulagate:
5+
image: technologystar/nebulagate:latest # ← NebulaGate 镜像
6+
container_name: nebulagate
217
restart: always
22-
command: --log-dir /app/logs
238
ports:
249
- "3000:3000"
10+
command: --log-dir /app/logs
2511
volumes:
2612
- ./data:/data
2713
- ./logs:/app/logs
2814
environment:
29-
- SQL_DSN=postgresql://root:123456@postgres:5432/new-api # ⚠️ IMPORTANT: Change the password in production!
30-
# - SQL_DSN=root:123456@tcp(mysql:3306)/new-api # Point to the mysql service, uncomment if using MySQL
15+
- SQL_DSN=postgresql://root:123456@postgres:5432/nebulagate
3116
- REDIS_CONN_STRING=redis://redis
3217
- TZ=Asia/Shanghai
33-
- ERROR_LOG_ENABLED=true # 是否启用错误日志记录 (Whether to enable error log recording)
34-
- BATCH_UPDATE_ENABLED=true # 是否启用批量更新 (Whether to enable batch update)
35-
# - STREAMING_TIMEOUT=300 # 流模式无响应超时时间,单位秒,默认120秒,如果出现空补全可以尝试改为更大值 (Streaming timeout in seconds, default is 120s. Increase if experiencing empty completions)
36-
# - SESSION_SECRET=random_string # 多机部署时设置,必须修改这个随机字符串!! (multi-node deployment, set this to a random string!!!!!!!)
37-
# - SYNC_FREQUENCY=60 # Uncomment if regular database syncing is needed
38-
# - GOOGLE_ANALYTICS_ID=G-XXXXXXXXXX # Google Analytics 的测量 ID (Google Analytics Measurement ID)
39-
# - UMAMI_WEBSITE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx # Umami 网站 ID (Umami Website ID)
40-
# - UMAMI_SCRIPT_URL=https://analytics.umami.is/script.js # Umami 脚本 URL,默认为官方地址 (Umami Script URL, defaults to official URL)
41-
18+
- ERROR_LOG_ENABLED=true
19+
- BATCH_UPDATE_ENABLED=true
20+
# - SESSION_SECRET=请改成随机字符串(多机必配)
4221
depends_on:
4322
- redis
4423
- postgres
45-
# - mysql # Uncomment if using MySQL
4624
healthcheck:
4725
test: ["CMD-SHELL", "wget -q -O - http://localhost:3000/api/status | grep -o '\"success\":\\s*true' || exit 1"]
4826
interval: 30s
@@ -60,25 +38,10 @@ services:
6038
restart: always
6139
environment:
6240
POSTGRES_USER: root
63-
POSTGRES_PASSWORD: 123456 # ⚠️ IMPORTANT: Change this password in production!
64-
POSTGRES_DB: new-api
41+
POSTGRES_PASSWORD: 123456 # 生产务必修改
42+
POSTGRES_DB: nebulagate
6543
volumes:
6644
- pg_data:/var/lib/postgresql/data
67-
# ports:
68-
# - "5432:5432" # Uncomment if you need to access PostgreSQL from outside Docker
69-
70-
# mysql:
71-
# image: mysql:8.2
72-
# container_name: mysql
73-
# restart: always
74-
# environment:
75-
# MYSQL_ROOT_PASSWORD: 123456 # ⚠️ IMPORTANT: Change this password in production!
76-
# MYSQL_DATABASE: new-api
77-
# volumes:
78-
# - mysql_data:/var/lib/mysql
79-
# ports:
80-
# - "3306:3306" # Uncomment if you need to access MySQL from outside Docker
8145

8246
volumes:
8347
pg_data:
84-
# mysql_data:

0 commit comments

Comments
 (0)