From b50a3716348cccee8a3dedc1d58f80f22992c2a8 Mon Sep 17 00:00:00 2001 From: Renfred Harper Date: Thu, 25 Sep 2014 23:14:32 +0000 Subject: [PATCH 1/2] Add start script --- scripts/start | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 scripts/start diff --git a/scripts/start b/scripts/start new file mode 100755 index 0000000..2561c68 --- /dev/null +++ b/scripts/start @@ -0,0 +1,8 @@ +#!/bin/bash +# Run this script to start Apache and MySQL +# +# Start MySQL +mysqld & +# Start Apache +source /etc/apache2/envvars +exec apache2 -D FOREGROUND From ec677096c60fc17d527ffe89db9274646eda9c1d Mon Sep 17 00:00:00 2001 From: Renfred Harper Date: Tue, 7 Oct 2014 18:25:18 +0000 Subject: [PATCH 2/2] Add Dockerfile --- Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..43da1aa --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM ubuntu:14.04 + +# Install base packages +RUN apt-get update +RUN apt-get -y install git curl nano wget build-essential + +# Install apache and PHP +RUN apt-get -y install apache2 mysql-server libapache2-mod-php5 +RUN apt-get -y install php5-mysql php5-gd php5-curl +#RUN sed -i "s/variables_order.*/variables_order = \"EGPCS\"/g" /etc/php5/apache2/php.ini + +# Decouple database from container +VOLUME ["/database"] + +# Configure the database to use our data dir +RUN sed -i -e "s/^datadir\s*=.*/datadir = \/database/" /etc/mysql/my.cnf + +# Link /var/www to /app directory +RUN mkdir -p /app && rm -fr /var/www/html && ln -s /app /var/www/html +WORKDIR /app + +# Clone lychee +RUN git clone https://github.com/renfredxh/Lychee.git . + +# Set file permissions +RUN chown www-data:www-data /app -R +RUN chmod -R 777 uploads/ data/ + +EXPOSE 80 +CMD scripts/start