[PATCH v2 2/4] Simplify docker-compose MySQL setup

Daniel Axtens dja at axtens.net
Fri Oct 20 16:36:54 AEDT 2017


This moves the config from a separate Dockerfile to something
integrated into the docker-compose.yml file.

Signed-off-by: Daniel Axtens <dja at 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

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.
-
-- 
2.11.0



More information about the Patchwork mailing list