[2/4] Simplify docker-compose MySQL setup

Message ID 20170903151444.25660-3-dja@axtens.net
State Under Review
Delegated to: Stephen Finucane
Headers show
Series
  • PostgreSQL fixes and test support
Related show

Commit Message

Daniel Axtens Sept. 3, 2017, 3:14 p.m.
This moves the config from a separate Dockerfile to something
integrated into the docker-compose.yml file.

Signed-off-by: Daniel Axtens <dja@axtens.net>

---

Having this set up with an image rather than a build makes it much
easier for the postgres file to come.
---
 docker-compose.yml            |  9 +++++++--
 tools/docker/db/.dockerignore |  1 -
 tools/docker/db/Dockerfile    | 10 ----------
 3 files changed, 7 insertions(+), 13 deletions(-)
 delete mode 100644 tools/docker/db/.dockerignore
 delete mode 100644 tools/docker/db/Dockerfile

Comments

Stephen Finucane Sept. 7, 2017, 6:19 p.m. | #1
On Mon, 2017-09-04 at 01:14 +1000, Daniel Axtens wrote:
> This moves the config from a separate Dockerfile to something
> integrated into the docker-compose.yml file.
> 
> Signed-off-by: Daniel Axtens <dja@axtens.net>

Yup, easy win.

Reviewed-by: Stephen Finucane <stephen@that.guru>

Patch

diff --git a/docker-compose.yml b/docker-compose.yml
index 7db3486ac734..47786eca9836 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -5,9 +5,14 @@ 
 # or upgrade to v2 and use the build-arg to override it.
 
 db:
-  build: tools/docker/db
+  image: mysql:5.7
   volumes:
-   - ./tools/docker/db/data:/var/lib/mysql
+    - ./tools/docker/db/data:/var/lib/mysql
+  environment:
+    - MYSQL_ROOT_PASSWORD=password
+    - MYSQL_USER=patchwork
+    - MYSQL_PASSWORD=password
+
 web:
   build: .
   dockerfile: ./tools/docker/Dockerfile
diff --git a/tools/docker/db/.dockerignore b/tools/docker/db/.dockerignore
deleted file mode 100644
index 1269488f7fb1..000000000000
--- a/tools/docker/db/.dockerignore
+++ /dev/null
@@ -1 +0,0 @@ 
-data
diff --git a/tools/docker/db/Dockerfile b/tools/docker/db/Dockerfile
deleted file mode 100644
index 5df9b5acb486..000000000000
--- a/tools/docker/db/Dockerfile
+++ /dev/null
@@ -1,10 +0,0 @@ 
-FROM mysql:5.7
-
-ENV MYSQL_ROOT_PASSWORD password
-ENV MYSQL_USER patchwork
-ENV MYSQL_PASSWORD password
-
-# We don't want to use the MYSQL_DATABASE env here because
-# we want to be able to create the database with UTF-8 explictly.
-# We also can't load in the data because it's in XML, yay.
-