From 5a9da9deed79258c33e43f73047b7bdc8adf9e17 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Sat, 7 Dec 2019 23:58:06 -0600 Subject: [PATCH] add mysql client config to server images This makes it trivial to do `docker-compose exec mysql` to get a connection to the database. --- Dockerfile.mysqld | 2 ++ docker-compose.yml | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 Dockerfile.mysqld diff --git a/Dockerfile.mysqld b/Dockerfile.mysqld new file mode 100644 index 0000000..31934d5 --- /dev/null +++ b/Dockerfile.mysqld @@ -0,0 +1,2 @@ +FROM mysql:5.7 +COPY etc/docker/mysql.conf /root/.my.cnf diff --git a/docker-compose.yml b/docker-compose.yml index 49037c2..3049222 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,18 @@ version: '3' services: db_tester: - image: mysql:5.7 + build: + context: . + dockerfile: Dockerfile.mysqld environment: - MYSQL_ROOT_PASSWORD: rootpw MYSQL_DATABASE: cpantesters + MYSQL_ROOT_PASSWORD: rootpw volumes: - db_tester:/var/lib/mysql db_web: - image: mysql:5.7 + build: + context: . + dockerfile: Dockerfile.mysqld environment: MYSQL_ROOT_PASSWORD: rootpw MYSQL_DATABASE: cpantesters_web