-
-
Save Ixtalo/06fa139fe33518aa0c105d77e9c40f6a to your computer and use it in GitHub Desktop.
docker-lighttpd-grav-skeleton-knowledge-base
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
FROM debian:buster | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
lighttpd \ | |
unzip \ | |
git \ | |
curl \ | |
cron \ | |
vim \ | |
php7.3 \ | |
php7.3-cgi \ | |
php7.3-curl \ | |
php7.3-gd \ | |
php7.3-mbstring \ | |
php7.3-xml \ | |
php7.3-zip \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN chown -R www-data:www-data /var/www | |
USER www-data | |
WORKDIR /var/www/html | |
#COPY grav-skeleton-knowledge-base.zip . | |
RUN test -e grav-skeleton-knowledge-base.zip || curl -Lk -o grav-skeleton-knowledge-base.zip https://getgrav.org/download/skeletons/knowledge-base-site/1.0.9 \ | |
# unzips to subdir ./grav/ | |
&& unzip grav-skeleton-knowledge-base.zip \ | |
## rename to grav_path/ (as in shipped webserver-configs/lighttpd.conf) | |
&& mv grav/ grav_path/ | |
USER root | |
RUN lighttpd-enable-mod rewrite | |
RUN lighttpd-enable-mod fastcgi | |
RUN lighttpd-enable-mod fastcgi-php | |
RUN echo "include \"/var/www/html/grav_path/webserver-configs/lighttpd.conf\"" >> /etc/lighttpd/lighttpd.conf \ | |
## commenting duplicate line | |
## https://stackoverflow.com/questions/17998763/sed-commenting-a-line-matching-a-specific-string-and-that-is-not-already-comme | |
&& sed -i -e "/url.access-deny/ s/^#*/#/" /etc/lighttpd/lighttpd.conf | |
# provide container inside image for data persistence | |
VOLUME ["/var/www/html"] | |
CMD ["sh", "-c", "service lighttpd start && tail -f /var/log/lighttpd/error.log"] | |
## docker run --rm -ti --name grav -p 8008:80 grav |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment