text-classify-ui/docker-compose.yml
superlishunqin 50293df5f3 fix_logout
2025-05-07 22:11:41 +08:00

38 lines
935 B
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.

# docker-compose.yml
version: '3'
services:
web:
build: .
restart: always
ports:
- "5000:5000"
volumes:
- ./uploads:/app/uploads
- ./model:/app/model
environment:
- DB_HOST=27.124.22.104
- DB_USER=ziyao
- DB_PASSWORD=ziyao123
- DB_NAME=text_classification_system
- FLASK_APP=app.py
- FLASK_ENV=production
command: gunicorn --bind 0.0.0.0:5000 app:app --workers 4 --timeout 120
# 如果需要在本地运行MySQL可以取消下面的注释
# db:
# image: mysql:8.0
# restart: always
# environment:
# MYSQL_ROOT_PASSWORD: root_password
# MYSQL_DATABASE: text_classification_system
# MYSQL_USER: ziyao
# MYSQL_PASSWORD: ziyao123
# volumes:
# - mysql_data:/var/lib/mysql
# - ./database/schema.sql:/docker-entrypoint-initdb.d/schema.sql
# ports:
# - "3306:3306"
# volumes:
# mysql_data: