Commit e66e04ee authored by Michiel de Jong's avatar Michiel de Jong

backup cron

parent 1903aa59
......@@ -5,6 +5,7 @@ ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get -yq install \
apache2 \
cron \
curl \
git \
libapache2-mod-php5 \
......@@ -21,6 +22,7 @@ RUN apt-get update \
# Add image configuration and scripts
ADD default.conf /etc/apache2/sites-enabled/000-default.conf
ADD run.sh /run.sh
ADD backup.cron /etc/cron.d/backup.cron
RUN sed -i "s/variables_order.*/variables_order = \"EGPCS\"/g" /etc/php5/apache2/php.ini \
&& a2enmod rewrite \
&& chmod 755 /run.sh
......
# lamp-git
This image pulls in a database dump and a www-content folder from a git repo, and hosts it as a lamp application.
````
sudo docker build -t indiehosters/lamp-git .
sudo docker run -d -e DATA_REPO=git@123.123.123.123:test.dev -e SECONDARY_REPO=git@124.124.124.124:test.dev -v /home/user/.ssh:/root/.ssh indiehosters/lamp-git
````
0 * * * * root cd /data; mysqldump --all-databases > dump.sql; git add *; git commit -am"backup `date`"; git push -u origin master; git push -u secondary master
#!/bin/bash
git clone $DATA_REPO /data
exec mysqld_safe &
exec cron &
git clone $DATA_REPO /data
cd /data
git remote add secondary $SECONDARY_REPO
git config --local user.email "backup@IndieHosters"
git config --local user.name "IndieHosters backup"
git config --global push.default simple
sleep 5
mysql < /data/dump.sql
source /etc/apache2/envvars
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment