From 028af28105d6d45f5501c343fcf2795d73db078e Mon Sep 17 00:00:00 2001 From: Gage Gaskins Date: Fri, 11 Sep 2015 15:37:37 -0400 Subject: [PATCH 1/3] Dockerfile for Tornadik and Piwik boxes --- piwik/Dockerfile | 19 +++++++++++++++++++ piwik/docker-compose.yml | 18 ++++++++++++++++++ tornadik/Dockerfile | 5 +++++ 3 files changed, 42 insertions(+) create mode 100644 piwik/Dockerfile create mode 100644 piwik/docker-compose.yml create mode 100644 tornadik/Dockerfile diff --git a/piwik/Dockerfile b/piwik/Dockerfile new file mode 100644 index 0000000..75c7cd0 --- /dev/null +++ b/piwik/Dockerfile @@ -0,0 +1,19 @@ +FROM php:5.6-apache + +RUN apt-get update && apt-get install -y \ + libfreetype6-dev \ + libjpeg-dev \ + libpng12-dev \ + && docker-php-ext-configure gd --with-freetype-dir=/usr/include \ + && docker-php-ext-install gd + +RUN docker-php-ext-install pdo_mysql + +RUN docker-php-ext-install mbstring + +RUN curl -L -O http://builds.piwik.org/piwik.tar.gz \ + && tar --strip 1 -xzf piwik.tar.gz \ + && rm piwik.tar.gz \ + && chown -R www-data:www-data /var/www/html + +RUN echo "always_populate_raw_post_data=-1" >> /usr/local/etc/php/php.ini \ No newline at end of file diff --git a/piwik/docker-compose.yml b/piwik/docker-compose.yml new file mode 100644 index 0000000..a86bcfd --- /dev/null +++ b/piwik/docker-compose.yml @@ -0,0 +1,18 @@ +piwik: + build: ../piwik + ports: + - "80:80" + links: + - mysql + restart: always + +mysql: + image: mysql:latest + ports: + - "3307:3306" + environment: + - MYSQL_USER=root + - MYSQL_ROOT_PASSWORD=password + - MYSQL_PASSWORD=password + - MYSQL_DATABASE=piwik + restart: always \ No newline at end of file diff --git a/tornadik/Dockerfile b/tornadik/Dockerfile new file mode 100644 index 0000000..d539c80 --- /dev/null +++ b/tornadik/Dockerfile @@ -0,0 +1,5 @@ +FROM python:latest + +RUN apt-get update && apt-get install -y git + +RUN git clone https://github.com/GageGaskins/tornadik.git \ No newline at end of file From 127f351ef1679219db6fba54aefd90801898db5e Mon Sep 17 00:00:00 2001 From: Gage Gaskins Date: Fri, 18 Sep 2015 11:54:35 -0400 Subject: [PATCH 2/3] Docker compose file for all images --- piwik/docker-compose.yml | 22 ++++++++++++++++++---- tornadik/Dockerfile | 6 +++++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/piwik/docker-compose.yml b/piwik/docker-compose.yml index a86bcfd..ffa106f 100644 --- a/piwik/docker-compose.yml +++ b/piwik/docker-compose.yml @@ -1,18 +1,32 @@ +storage: + image: busybox:latest + volumes: + - /tmp + # - /code + - /data/db piwik: build: ../piwik ports: - "80:80" links: - mysql - restart: always mysql: image: mysql:latest ports: - "3307:3306" environment: - - MYSQL_USER=root - MYSQL_ROOT_PASSWORD=password - - MYSQL_PASSWORD=password - MYSQL_DATABASE=piwik - restart: always \ No newline at end of file + volumes_from: + - storage + volumes: + - ~/dumps/Dump20150916/:/tmp/dumps + +tornadik: + build: ../tornadik + ports: + - "7000:7000" + volumes: + - tmp/test + - ~/tornadik/tornadik/piwik/:/tmp \ No newline at end of file diff --git a/tornadik/Dockerfile b/tornadik/Dockerfile index d539c80..80dd595 100644 --- a/tornadik/Dockerfile +++ b/tornadik/Dockerfile @@ -2,4 +2,8 @@ FROM python:latest RUN apt-get update && apt-get install -y git -RUN git clone https://github.com/GageGaskins/tornadik.git \ No newline at end of file +RUN git clone https://github.com/GageGaskins/tornadik.git + +WORKDIR /tornadik + +RUN pip install -U -r requirements.txt \ No newline at end of file From d31ad08d7e61eff2086b8950da337b0f2bb16c57 Mon Sep 17 00:00:00 2001 From: Gage Gaskins Date: Mon, 21 Sep 2015 14:32:09 -0400 Subject: [PATCH 3/3] Tornadik Dockerfile now runs Tornadik with settings.py --- piwik/Dockerfile | 7 ++++++- piwik/docker-compose.yml | 4 ++-- tornadik/Dockerfile | 6 ++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/piwik/Dockerfile b/piwik/Dockerfile index 75c7cd0..d2954e2 100644 --- a/piwik/Dockerfile +++ b/piwik/Dockerfile @@ -16,4 +16,9 @@ RUN curl -L -O http://builds.piwik.org/piwik.tar.gz \ && rm piwik.tar.gz \ && chown -R www-data:www-data /var/www/html -RUN echo "always_populate_raw_post_data=-1" >> /usr/local/etc/php/php.ini \ No newline at end of file +RUN echo "always_populate_raw_post_data=-1" >> /usr/local/etc/php/php.ini + +#RUN mkdir /tmp/dumps + +#RUN cd /tmp/dumps \ + #&& find . -name '*.sql' | awk '{ print "source",$0 }' | mysql --batch -u root -p"password" piwik \ No newline at end of file diff --git a/piwik/docker-compose.yml b/piwik/docker-compose.yml index ffa106f..cf5155b 100644 --- a/piwik/docker-compose.yml +++ b/piwik/docker-compose.yml @@ -27,6 +27,6 @@ tornadik: build: ../tornadik ports: - "7000:7000" + - "8000:8000" volumes: - - tmp/test - - ~/tornadik/tornadik/piwik/:/tmp \ No newline at end of file + - ~/tornadik/tornadik/piwik:/tornadik/tornadik/piwik \ No newline at end of file diff --git a/tornadik/Dockerfile b/tornadik/Dockerfile index 80dd595..f39c31c 100644 --- a/tornadik/Dockerfile +++ b/tornadik/Dockerfile @@ -4,6 +4,8 @@ RUN apt-get update && apt-get install -y git RUN git clone https://github.com/GageGaskins/tornadik.git -WORKDIR /tornadik +WORKDIR /tornadik -RUN pip install -U -r requirements.txt \ No newline at end of file +RUN pip install -U -r requirements.txt + +CMD ["python", "-m", "tornadik.server.app"] \ No newline at end of file