Skip to content

Commit 5719dd8

Browse files
committed
Add container support
1 parent 7c9addb commit 5719dd8

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

Containerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM php:7-apache
2+
3+
RUN docker-php-ext-install exif
4+
5+
RUN set -eux; \
6+
\
7+
apt-get update; \
8+
apt-get install -y --no-install-recommends git; \
9+
rm -rf /var/lib/apt/lists/*; \
10+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
11+
12+
COPY --chown=www-data:www-data . /var/www/html
13+
14+
RUN set -eux; \
15+
\
16+
sed -i "s/BASE_PATH \\. //" /var/www/html/config.php; \
17+
sed -i "s/'GIT_COMMIT_ENABLED', false/'GIT_COMMIT_ENABLED', true/" /var/www/html/config.php
18+
19+
VOLUME /pages
20+
EXPOSE 80
21+
22+
CMD /var/www/html/container-start.sh

container-start.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# on empty volume copy default pages
5+
if ! test -f /pages/Home.md ; then
6+
cp /var/www/html/pages/* /pages
7+
8+
(
9+
cd /pages
10+
git init
11+
git config user.email "w2wiki@w2wiki"
12+
git config user.name "w2wiki"
13+
14+
git add -A .
15+
git commit -m "Init with default pages"
16+
)
17+
fi
18+
19+
mkdir -p /pages/images
20+
chown -R www-data:www-data /pages
21+
22+
exec apache2-foreground "$@"

0 commit comments

Comments
 (0)