From dd40222fd651891a9e8ec271afb6186f0886b5bc Mon Sep 17 00:00:00 2001 From: Chris Rose Date: Sun, 9 Apr 2017 10:38:19 -0700 Subject: [PATCH] Dockerize magnetico as a pair of conjoined containers docker-compose links them, they share a DB on a volume container, and expose the web interface on the host port 12345 --- docker-compose.yml | 20 ++++++++++++++++++++ magneticod/.dockerignore | 2 ++ magneticod/Dockerfile | 9 +++++++++ magneticow/.dockerignore | 2 ++ magneticow/Dockerfile | 10 ++++++++++ 5 files changed, 43 insertions(+) create mode 100644 docker-compose.yml create mode 100644 magneticod/.dockerignore create mode 100644 magneticod/Dockerfile create mode 100644 magneticow/.dockerignore create mode 100644 magneticow/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2e52ae5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: "2" + +volumes: + shared_db: + +services: + magneticod: + build: + context: magneticod + volumes: + - shared_db:/root/.local/share + + magneticow: + build: + context: magneticow + volumes: + - shared_db:/root/.local/share + + ports: + - "12345:8080" diff --git a/magneticod/.dockerignore b/magneticod/.dockerignore new file mode 100644 index 0000000..4a246ec --- /dev/null +++ b/magneticod/.dockerignore @@ -0,0 +1,2 @@ +Dockerfile +.dockerignore diff --git a/magneticod/Dockerfile b/magneticod/Dockerfile new file mode 100644 index 0000000..20e8809 --- /dev/null +++ b/magneticod/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.6 + +RUN mkdir -p /usr/src/app + +WORKDIR /usr/src/app + +COPY . . +RUN pip install -e . +CMD ["python", "-mmagneticod"] diff --git a/magneticow/.dockerignore b/magneticow/.dockerignore new file mode 100644 index 0000000..4a246ec --- /dev/null +++ b/magneticow/.dockerignore @@ -0,0 +1,2 @@ +Dockerfile +.dockerignore diff --git a/magneticow/Dockerfile b/magneticow/Dockerfile new file mode 100644 index 0000000..2942164 --- /dev/null +++ b/magneticow/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.6 + +RUN mkdir -p /usr/src/app + +WORKDIR /usr/src/app + +COPY . . +RUN pip install -e . +EXPOSE 8080 +CMD ["python", "-mmagneticow", "--port", "8080", "--user", "user", "password"]