From 26fc70a5ae613c8620d951c8acaccdf05ad14c88 Mon Sep 17 00:00:00 2001 From: Petr Pridal Date: Fri, 4 Sep 2015 16:54:39 +0200 Subject: [PATCH] Initial commit of Docker resources --- 000-default.conf | 16 ++++++++++++++++ Dockerfile | 25 +++++++++++++++++++++++++ start.sh | 15 +++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 000-default.conf create mode 100644 Dockerfile create mode 100644 start.sh diff --git a/000-default.conf b/000-default.conf new file mode 100644 index 0000000..93e0078 --- /dev/null +++ b/000-default.conf @@ -0,0 +1,16 @@ + + ServerName localhost + ServerAdmin webmaster@localhost + + LogLevel info + ErrorLog "|/bin/cat" + LogFormat "%h %l %u %t \"%r\" %>s %b" common + CustomLog "|/bin/cat" common + + DocumentRoot /var/www/ + + AllowOverride all + Order allow,deny + Allow from all + + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0973154 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM debian:jessie + +RUN apt-get update -y && apt-get install -qq -y \ + apache2 \ + php5 \ + php5-sqlite \ + unzip + +COPY 000-default.conf /etc/apache2/sites-available/000-default.conf + +RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf && \ + a2enconf servername && a2enmod rewrite + +ADD start.sh \ + https://github.com/klokantech/tileserver-php/archive/master.zip / + +RUN chmod +x /start.sh && \ + unzip master.zip && \ + rm -Rf /var/www && \ + cp -rf /tileserver-php-master /var/www + +VOLUME /var/www +EXPOSE 80 + +CMD ["/start.sh"] diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..62a6e22 --- /dev/null +++ b/start.sh @@ -0,0 +1,15 @@ +#!/bin/bash +echo "Starting tileserver-php container" +echo "---------------------------------" +file="/var/www/tileserver.php" +if [ -f "$file" ] +then + echo "$file found in the volume." +else + echo "Copying tileserver.php into volume..." + cp /tileserver-php-master/* /tileserver-php-master/.* /var/www/ +fi +echo +echo "Apache logs:" +echo +/usr/sbin/apache2ctl -e info -D FOREGROUND