forked from panicsteve/w2wiki
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM php:7-apache | ||
|
||
RUN docker-php-ext-install exif | ||
|
||
RUN set -eux; \ | ||
\ | ||
apt-get update; \ | ||
apt-get install -y --no-install-recommends git; \ | ||
rm -rf /var/lib/apt/lists/*; \ | ||
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false | ||
|
||
COPY --chown=www-data:www-data . /var/www/html | ||
|
||
RUN set -eux; \ | ||
\ | ||
sed -i "s/BASE_PATH \\. //" /var/www/html/config.php; \ | ||
sed -i "s/'GIT_COMMIT_ENABLED', false/'GIT_COMMIT_ENABLED', true/" /var/www/html/config.php | ||
|
||
VOLUME /pages | ||
EXPOSE 80 | ||
|
||
CMD /var/www/html/container-start.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# on empty volume copy default pages | ||
if ! test -f /pages/Home.md ; then | ||
cp /var/www/html/pages/* /pages | ||
|
||
( | ||
cd /pages | ||
git init | ||
git config user.email "w2wiki@w2wiki" | ||
git config user.name "w2wiki" | ||
|
||
git add -A . | ||
git commit -m "Init with default pages" | ||
) | ||
fi | ||
|
||
mkdir -p /pages/images | ||
chown -R www-data:www-data /pages | ||
|
||
exec apache2-foreground "$@" |