Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
applications
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
indiehost
applications
Commits
e66e04ee
Commit
e66e04ee
authored
Dec 01, 2014
by
Michiel de Jong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backup cron
parent
1903aa59
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
1 deletion
+19
-1
Dockerfile
per-user/lamp-git/Dockerfile
+2
-0
README.md
per-user/lamp-git/README.md
+9
-0
backup.cron
per-user/lamp-git/backup.cron
+1
-0
run.sh
per-user/lamp-git/run.sh
+7
-1
No files found.
per-user/lamp-git/Dockerfile
View file @
e66e04ee
...
...
@@ -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
...
...
per-user/lamp-git/README.md
0 → 100644
View file @
e66e04ee
# 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
````
per-user/lamp-git/backup.cron
0 → 100644
View file @
e66e04ee
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
per-user/lamp-git/run.sh
View file @
e66e04ee
#!/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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment