feat(database): add MySQL database support (#201)

This commit is contained in:
521141
2025-07-17 19:44:01 +08:00
committed by GitHub
parent 0ee5ef316f
commit bb5fad47cb
6 changed files with 194 additions and 26 deletions
+28
View File
@@ -13,7 +13,35 @@ services:
- JWT_SECRET=
- INIT_TABLE=true
- ENABLE_CACHE=true
# MySQL Database Configuration (uncomment to use MySQL instead of SQLite)
# - MYSQL_HOST=mysql
# - MYSQL_PORT=3306
# - MYSQL_USER=newsnow
# - MYSQL_PASSWORD=your_password
# - MYSQL_DATABASE=newsnow
# - MYSQL_SSL=false
# Uncomment the following lines to use MySQL database
# depends_on:
# - mysql
# Uncomment the following service to use MySQL database
# mysql:
# image: mysql:8.0
# container_name: newsnow_mysql
# restart: always
# environment:
# MYSQL_ROOT_PASSWORD: root_password
# MYSQL_DATABASE: newsnow
# MYSQL_USER: newsnow
# MYSQL_PASSWORD: your_password
# ports:
# - "3306:3306"
# volumes:
# - mysql_data:/var/lib/mysql
# command: --default-authentication-plugin=mysql_native_password
volumes:
newsnow_data:
name: newsnow_data
# mysql_data:
# name: newsnow_mysql_data