-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (55 loc) · 2.03 KB
/
docker-compose.yml
File metadata and controls
57 lines (55 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
services:
namblog:
# build:
# context: .
# dockerfile: Dockerfile
# image: namblog:latest
# 本地构建使用上面的 build 配置
# 生产环境使用下面的 image 配置
image: ghcr.io/code-gal/namblog:latest
# image: ghcr.io/code-gal/namblog:0.8.0 # 或指定具体版本
container_name: namblog
restart: unless-stopped
ports:
- "5000:8080"
volumes:
- ./data:/app/data
# - /etc/localtime:/etc/localtime:ro
environment:
- ASPNETCORE_ENVIRONMENT=Production
# 注意:建议在 data/config/config.json 中配置(支持热重载)
# 环境变量仅用于覆盖配置文件中的值(可选)
# 支持的环境变量示例:
# - AI__ApiKey=sk-xxx
# - AI__BaseUrl=https://api.openai.com/v1
# - AI__Model=gpt-4
# - Jwt__Secret=your-secret-key
# - MCP__AuthToken=your-mcp-token
# - Blog__Domain=https://yourdomain.com
# - Cors__AllowedOrigins=https://yourdomain.com
# 可选:PostgreSQL 数据库(如果不使用 SQLite)
# 使用步骤:
# 1. 取消注释 postgres 服务和 volumes 配置
# 2. 在 data/config/config.json 中设置:
# "DatabaseProvider": "PostgreSQL",
# "ConnectionStrings": {
# "PostgreSQL": "Host=postgres;Port=5432;Database=namblog;Username=namblog;Password=your_password"
# }
# 3. 或通过环境变量设置(在 namblog 服务的 environment 中添加):
# - DatabaseProvider=PostgreSQL
# - ConnectionStrings__PostgreSQL=Host=postgres;Port=5432;Database=namblog;Username=namblog;Password=your_password
#
# postgres:
# image: postgres:17-alpine
# container_name: namblog-postgres
# restart: unless-stopped
# environment:
# - POSTGRES_DB=namblog
# - POSTGRES_USER=namblog
# - POSTGRES_PASSWORD=your_password # 请修改为强密码
# volumes:
# - postgres_data:/var/lib/postgresql/data
# ports:
# - "5432:5432" # 可选:暴露端口用于外部管理工具访问
# volumes:
# postgres_data: