Files
tsp-assistant/docker-compose.yml
2025-09-08 15:27:22 +08:00

59 lines
1.3 KiB
YAML
Raw Permalink 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:
tsp-assistant:
build: .
container_name: tsp_assistant
ports:
- "5000:5000"
environment:
- PYTHONPATH=/app
- DATABASE_URL=sqlite:///tsp_assistant.db
volumes:
- ./data:/app/data
- ./logs:/app/logs
- ./backups:/app/backups
- tsp_db:/app
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# MySQL数据库服务可选
mysql:
image: mysql:8.0
container_name: tsp_mysql
environment:
MYSQL_ROOT_PASSWORD: root123456
MYSQL_DATABASE: tsp_assistant
MYSQL_USER: tsp_user
MYSQL_PASSWORD: tsp_password
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
restart: unless-stopped
command: --default-authentication-plugin=mysql_native_password
# Nginx反向代理可选
nginx:
image: nginx:alpine
container_name: tsp_nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./ssl:/etc/nginx/ssl
depends_on:
- tsp-assistant
restart: unless-stopped
volumes:
tsp_db:
mysql_data: