Files
template-10556/docker-compose.yml
2025-07-22 13:27:07 +08:00

49 lines
1.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: '3.8'
services:
web:
build:
context: .
dockerfile: Dockerfile
container_name: ai-chat-web
ports:
- "3000:80"
restart: unless-stopped
environment:
- TZ=Asia/Shanghai
volumes:
# 可选如果需要持久化nginx日志
- ./logs:/var/log/nginx
networks:
- ai-chat-network
labels:
- "traefik.enable=true"
- "traefik.http.routers.ai-chat.rule=Host(`localhost`)"
- "traefik.http.services.ai-chat.loadbalancer.server.port=80"
# 可选:如果需要反向代理
nginx-proxy:
image: nginx:alpine
container_name: ai-chat-proxy
ports:
- "80:80"
- "443:443"
volumes:
- ./proxy.conf:/etc/nginx/conf.d/default.conf
- ./ssl:/etc/nginx/ssl # SSL证书目录如果需要HTTPS
depends_on:
- web
restart: unless-stopped
networks:
- ai-chat-network
profiles:
- proxy # 使用profile控制是否启动代理
networks:
ai-chat-network:
driver: bridge
volumes:
logs:
driver: local