From ba32dedbefda5685059a953a4f60a64fe1a73151 Mon Sep 17 00:00:00 2001 From: Diego Antunes Date: Tue, 18 Apr 2017 10:19:09 +1200 Subject: [PATCH] Added Percona container as an alternative to mysql mariadb --- .../content/getting-started/index.md | 8 ++++---- docker-compose.yml | 19 +++++++++++++++++++ env-example | 7 +++++++ percona/Dockerfile | 11 +++++++++++ percona/my.cnf | 9 +++++++++ 5 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 percona/Dockerfile create mode 100644 percona/my.cnf diff --git a/DOCUMENTATION/_settings/content/getting-started/index.md b/DOCUMENTATION/_settings/content/getting-started/index.md index 5959096c..74f7143d 100644 --- a/DOCUMENTATION/_settings/content/getting-started/index.md +++ b/DOCUMENTATION/_settings/content/getting-started/index.md @@ -81,7 +81,7 @@ Your folder structure should look like this: *Or you can keep `default.conf` as it is, and create a separate config `my-site.conf` file for it.* -**In case of Apache:** :P +**In case of Apache:** :P
@@ -168,7 +168,7 @@ docker-compose up -d nginx mysql You can select your own combination of containers form the list below: -> `nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `rabbitmq`, `beanstalkd-console`, `workspace`, `phpmyadmin`, `adminer`, `aerospike`, `pgadmin`, `elasticsearch`, `rethinkdb`, `postgres-postgis`, `certbot`, `mailhog`, `minio` and more...! +> `nginx`, `hhvm`, `php-fpm`, `mysql`, `percona`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `rabbitmq`, `beanstalkd-console`, `workspace`, `phpmyadmin`, `adminer`, `aerospike`, `pgadmin`, `elasticsearch`, `rethinkdb`, `postgres-postgis`, `certbot`, `mailhog`, `minio` and more...! *(Please note that sometimes we forget to update the docs, so check the `docker-compose.yml` file to see an updated list of all available containers).* @@ -186,7 +186,7 @@ docker-compose exec workspace bash docker exec -it {workspace-container-id} bash ``` -**Note:** You can add `--user=laradock` to have files created as your host's user. Example: +**Note:** You can add `--user=laradock` to have files created as your host's user. Example: ```shell docker-compose exec --user=laradock workspace bash @@ -206,6 +206,6 @@ DB_HOST=mysql *If you want to install Laravel as PHP project, see [How to Install Laravel in a Docker Container](#Install-Laravel).*
-5 - Open your browser and visit your localhost address `http://localhost/`. If you followed the multiple projects setup, you can visit `http://project-1.dev/` and `http://project-2.dev/`. But first don't +5 - Open your browser and visit your localhost address `http://localhost/`. If you followed the multiple projects setup, you can visit `http://project-1.dev/` and `http://project-2.dev/`. But first don't diff --git a/docker-compose.yml b/docker-compose.yml index c68e6020..93caa01c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -179,6 +179,23 @@ services: networks: - backend +### Percona Container ######################################### + + percona: + build: + context: ./percona + environment: + - MYSQL_DATABASE=${PERCONA_DATABASE} + - MYSQL_USER=${PERCONA_USER} + - MYSQL_PASSWORD=${PERCONA_PASSWORD} + - MYSQL_ROOT_PASSWORD=${PERCONA_ROOT_PASSWORD} + volumes: + - percona:/var/lib/mysql + ports: + - "${PERCONA_PORT}:3306" + networks: + - backend + ### MSSQL Container ######################################### mssql: @@ -529,6 +546,8 @@ networks: volumes: mysql: driver: "local" + percona: + driver: "local" mssql: driver: "local" postgres: diff --git a/env-example b/env-example index ef7c2582..53cfa744 100644 --- a/env-example +++ b/env-example @@ -70,6 +70,13 @@ MYSQL_PASSWORD=secret MYSQL_PORT=3306 MYSQL_ROOT_PASSWORD=root +### Percona Container +PERCONA_DATABASE=homestead +PERCONA_USER=homestead +PERCONA_PASSWORD=secret +PERCONA_PORT=3306 +PERCONA_ROOT_PASSWORD=root + ### MSSQL Container MSSQL_DATABASE=homestead MSSQL_PASSWORD=yourStrong(!)Password diff --git a/percona/Dockerfile b/percona/Dockerfile new file mode 100644 index 00000000..f66d0ded --- /dev/null +++ b/percona/Dockerfile @@ -0,0 +1,11 @@ +FROM percona:5.7 + +MAINTAINER DTUNES + +RUN chown -R mysql:root /var/lib/mysql/ + +ADD my.cnf /etc/mysql/conf.d/my.cnf + +CMD ["mysqld"] + +EXPOSE 3306 diff --git a/percona/my.cnf b/percona/my.cnf new file mode 100644 index 00000000..06595ca5 --- /dev/null +++ b/percona/my.cnf @@ -0,0 +1,9 @@ +# 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_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"