add docker version
This commit is contained in:
20
docker/mysql/Dockerfile
Normal file
20
docker/mysql/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
ARG MYSQL_VERSION
|
||||
FROM mysql:latest
|
||||
|
||||
LABEL maintainer="Ludovic CANDELLIER <ludo@huma.net>"
|
||||
|
||||
#####################################
|
||||
# Set Timezone
|
||||
#####################################
|
||||
|
||||
ARG TZ=UTC
|
||||
ENV TZ ${TZ}
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && chown -R mysql:root /var/lib/mysql/
|
||||
|
||||
COPY my.cnf /etc/mysql/conf.d/my.cnf
|
||||
|
||||
RUN chmod 0444 /etc/mysql/conf.d/my.cnf
|
||||
|
||||
CMD ["mysqld"]
|
||||
|
||||
EXPOSE 3306
|
||||
1
docker/mysql/docker-entrypoint-initdb.d/.gitignore
vendored
Normal file
1
docker/mysql/docker-entrypoint-initdb.d/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.sql
|
||||
33
docker/mysql/docker-entrypoint-initdb.d/createdb.sql.example
Normal file
33
docker/mysql/docker-entrypoint-initdb.d/createdb.sql.example
Normal file
@@ -0,0 +1,33 @@
|
||||
#
|
||||
# Copy createdb.sql.example to createdb.sql
|
||||
# then uncomment then set database name and username to create you need databases
|
||||
#
|
||||
# example: .env MYSQL_USER=appuser and needed db name is myshop_db
|
||||
#
|
||||
# CREATE DATABASE IF NOT EXISTS `myshop_db` ;
|
||||
# GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ;
|
||||
#
|
||||
#
|
||||
# this sql script will auto run when the mysql container starts and the $DATA_PATH_HOST/mysql not found.
|
||||
#
|
||||
# if your $DATA_PATH_HOST/mysql exists and you do not want to delete it, you can run by manual execution:
|
||||
#
|
||||
# docker-compose exec mysql bash
|
||||
# mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql
|
||||
#
|
||||
|
||||
#CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ;
|
||||
#GRANT ALL ON `dev_db_1`.* TO 'default'@'%' ;
|
||||
|
||||
#CREATE DATABASE IF NOT EXISTS `dev_db_2` COLLATE 'utf8_general_ci' ;
|
||||
#GRANT ALL ON `dev_db_2`.* TO 'default'@'%' ;
|
||||
|
||||
#CREATE DATABASE IF NOT EXISTS `dev_db_3` COLLATE 'utf8_general_ci' ;
|
||||
#GRANT ALL ON `dev_db_3`.* TO 'default'@'%' ;
|
||||
|
||||
#CREATE DATABASE IF NOT EXISTS `opensem` COLLATE 'utf8_general_ci' ;
|
||||
#GRANT ALL ON `opensem`.* TO 'opensem'@'%' ;
|
||||
|
||||
#GRANT ALL PRIVILEGES ON *.* TO opensem@localhost WITH GRANT OPTION;
|
||||
|
||||
FLUSH PRIVILEGES ;
|
||||
11
docker/mysql/my.cnf
Normal file
11
docker/mysql/my.cnf
Normal file
@@ -0,0 +1,11 @@
|
||||
# The MySQL Client configuration file.
|
||||
#
|
||||
# For explanations see
|
||||
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
|
||||
|
||||
[mysql]
|
||||
|
||||
[mysqld]
|
||||
sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
|
||||
character-set-server=utf8
|
||||
default-authentication-plugin=mysql_native_password
|
||||
Reference in New Issue
Block a user