-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
63 lines (61 loc) · 1.84 KB
/
docker-compose.yml
File metadata and controls
63 lines (61 loc) · 1.84 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
58
59
60
61
62
63
services:
banana-pro:
build:
context: .
dockerfile: Dockerfile
args:
# Docker 镜像源(国内用户推荐)
- DOCKER_REGISTRY=${DOCKER_REGISTRY:-}
# npm 镜像源
- NPM_REGISTRY=${NPM_REGISTRY:-}
# Go 模块代理
- GO_PROXY=${GO_PROXY:-}
container_name: banana-pro
ports:
- "8090:80" # 宿主机8090映射到容器80
volumes:
# 数据持久化:图片存储、数据库
- ./data/storage:/app/storage
# 配置文件挂载(可选:如果需要自定义配置)
- ./config.yaml:/app/config.yaml:ro
environment:
# 后端监听地址(Docker 必须用 0.0.0.0)
- SERVER_HOST=0.0.0.0
- SERVER_PORT=8080
# Gemini API 配置(可覆盖配置文件)
- GEMINI_API_KEY=${GEMINI_API_KEY:-}
- GEMINI_API_BASE=${GEMINI_API_BASE:-https://generativelanguage.googleapis.com}
# OpenAI API 配置(可覆盖配置文件)
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- OPENAI_API_BASE=${OPENAI_API_BASE:-https://api.openai.com/v1}
# 时区
- TZ=Asia/Shanghai
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/api/v1/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- banana-network
# 可选:Nginx 反向代理(生产环境推荐)
nginx:
image: nginx:alpine
container_name: banana-proxy
ports:
- "80:80"
- "443:443"
volumes:
- ./docker/nginx-proxy.conf:/etc/nginx/nginx.conf:ro
- ./docker/ssl:/etc/nginx/ssl:ro
depends_on:
- banana-pro
restart: unless-stopped
networks:
- banana-network
profiles:
- production # 仅在 production profile 时启动
networks:
banana-network:
driver: bridge