mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-27 13:29:58 +08:00
compose
This commit is contained in:
18
docker/mysql/Dockerfile
Normal file
18
docker/mysql/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM mysql:8.1
|
||||
|
||||
# 时区配置
|
||||
ARG TZ=UTC
|
||||
ENV TZ ${TIMEZONE}
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone && chown -R mysql:root /var/lib/mysql/
|
||||
|
||||
# 复制自定义的my.cnf
|
||||
COPY my.cnf /etc/mysql/conf.d/my.cnf
|
||||
|
||||
# my.cnf只读权限
|
||||
RUN chmod 0444 /etc/mysql/conf.d/my.cnf
|
||||
|
||||
# 暴露3306端口
|
||||
EXPOSE 3306
|
||||
|
||||
# 启动mysql
|
||||
CMD ["mysqld"]
|
||||
12
docker/mysql/my.cnf
Normal file
12
docker/mysql/my.cnf
Normal file
@@ -0,0 +1,12 @@
|
||||
# The MySQL Client configuration file.
|
||||
#
|
||||
# For explanations see
|
||||
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
|
||||
|
||||
[mysql]
|
||||
default-character-set=utf8mb4
|
||||
|
||||
[mysqld]
|
||||
sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
|
||||
character-set-server=utf8mb4
|
||||
default-authentication-plugin=mysql_native_password
|
||||
Reference in New Issue
Block a user