docs: 增加容器部署文档

This commit is contained in:
RockYang
2023-06-25 11:06:18 +08:00
parent d971e95900
commit 399a16fa28
10 changed files with 126 additions and 23 deletions

2
docker/mysql/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
data/*
logs/*

32
docker/mysql/conf/my.cnf Normal file
View File

@@ -0,0 +1,32 @@
#
# The MySQL database server configuration file.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
[mysqld]
#
# * Basic Settings
#
#user = mysql
# pid-file = /var/run/mysqld/mysqld.pid
# socket = /var/run/mysqld/mysqld.sock
# port = 3306
# datadir = /var/lib/mysql
# If MySQL is running as a replication slave, this should be
# changed. Ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_tmpdir
# tmpdir = /tmp
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 0.0.0.0
mysqlx-bind-address = 0.0.0.0

View File

@@ -0,0 +1,19 @@
version: '3'
services:
# 后端 API 程序
mysql:
image: mysql:8.0.33
container_name: chatgpt-plus-mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
- MYSQL_ROOT_PASSWORD=12345678
ports:
- "3307:3306"
volumes:
- ./conf/my.cnf:/etc/mysql/my.cnf
- ./data:/var/lib/mysql
- ./logs:/var/log/mysql