mysql adaptation (#59)

This commit is contained in:
longbingljw
2025-11-13 21:27:41 +08:00
committed by GitHub
parent 20403c69b2
commit 49d5637b3c
132 changed files with 6551 additions and 2624 deletions

View File

@ -1,15 +1,36 @@
# ------------------------------
# Environment Variables for db Service
# ------------------------------
# Database Configuration
# Database type, supported values are `postgresql` and `mysql`
DB_TYPE=postgresql
# PostgreSQL Configuration
POSTGRES_USER=postgres
# The password for the default postgres user.
POSTGRES_PASSWORD=difyai123456
# PostgreSQL host
POSTGRES_HOST=db_postgres
# PostgreSQL port
POSTGRES_PORT=5432
# The name of the default postgres database.
POSTGRES_DB=dify
# postgres data directory
PGDATA=/var/lib/postgresql/data/pgdata
PGDATA_HOST_VOLUME=./volumes/db/data
# MySQL Configuration
MYSQL_USER=mysql
# MySQL password
MYSQL_PASSWORD=difyai123456
# MySQL database name
MYSQL_DB=dify
# MySQL host
MYSQL_HOST=db_mysql
# MySQL port
MYSQL_PORT=3306
# MySQL data directory host volume
MYSQL_HOST_VOLUME=./volumes/mysql/data
# Maximum number of connections to the database
# Default is 100
#
@ -54,6 +75,28 @@ POSTGRES_STATEMENT_TIMEOUT=0
# A value of 0 prevents the server from terminating idle sessions.
POSTGRES_IDLE_IN_TRANSACTION_SESSION_TIMEOUT=0
# MySQL Performance Configuration
# Maximum number of connections to MySQL
# Default is 1000
MYSQL_MAX_CONNECTIONS=1000
# InnoDB buffer pool size
# Default is 512M
# Recommended value: 70-80% of available memory for dedicated MySQL server
# Reference: https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_buffer_pool_size
MYSQL_INNODB_BUFFER_POOL_SIZE=512M
# InnoDB log file size
# Default is 128M
# Reference: https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_log_file_size
MYSQL_INNODB_LOG_FILE_SIZE=128M
# InnoDB flush log at transaction commit
# Default is 2 (flush to OS cache, sync every second)
# Options: 0 (no flush), 1 (flush and sync), 2 (flush to OS cache)
# Reference: https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_flush_log_at_trx_commit
MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT=2
# -----------------------------
# Environment Variables for redis Service
# -----------------------------
@ -97,6 +140,7 @@ WEAVIATE_HOST_VOLUME=./volumes/weaviate
# Docker Compose Service Expose Host Port Configurations
# ------------------------------
EXPOSE_POSTGRES_PORT=5432
EXPOSE_MYSQL_PORT=3306
EXPOSE_REDIS_PORT=6379
EXPOSE_SANDBOX_PORT=8194
EXPOSE_SSRF_PROXY_PORT=3128