Browse Source

Initial commit

master
Chris Wiegman 9 months ago
commit
d041d66d41
Signed by: chriswiegman <chris@chriswiegman.com> GPG Key ID: 2B23D7A74FDE2DF4
4 changed files with 1985 additions and 0 deletions
  1. +45
    -0
      Dockerfile
  2. +2
    -0
      README.md
  3. +24
    -0
      entrypoint.sh
  4. +1914
    -0
      php.ini

+ 45
- 0
Dockerfile View File

@@ -0,0 +1,45 @@
FROM ubuntu

LABEL maintainer="Chris Wiegman <contact@chriswiegman.com>"

ENV DEBIAN_FRONTEND noninteractive

ARG PIWIGO_VERSION="2.9.5"

RUN apt-get update && \
apt-get install -yy software-properties-common && \
add-apt-repository ppa:ondrej/php -y && \
apt-get update \
&& apt-get install -yy \
apache2 \
libapache2-mod-php \
php7.3-gd \
php7.3-curl \
php7.3-mysql \
php7.3-mbstring \
php7.3-xml \
php7.3-imagick \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN wget -q -O piwigo.zip http://piwigo.org/download/dlcounter.php?code=$PIWIGO_VERSION && \
unzip piwigo.zip && \
rm /var/www/* -rf && \
mv piwigo/* /var/www/ && \
rm -r piwigo* && \
mkdir /template && \
mv /var/www/galleries /template/ && \
mv /var/www/themes /template/ && \
mv /var/www/plugins /template/ && \
mv /var/www/local /template/ && \
mkdir -p /var/www/_data/i /config && \
chown -R www-data:www-data /var/www

ADD php.ini /etc/php/7.3/apache2/php.ini
VOLUME ["/var/www/galleries", "/var/www/themes", "/var/www/plugins", "/var/www/local", "/var/www/_data/i", "/config"]

ADD entrypoint.sh /entrypoint.sh
RUN chmod u+x /entrypoint.sh
ENTRYPOINT /entrypoint.sh
EXPOSE 80

+ 2
- 0
README.md View File

@@ -0,0 +1,2 @@
Piwigo for Docker
-----

+ 24
- 0
entrypoint.sh View File

@@ -0,0 +1,24 @@
#!/bin/bash

for d in $(ls /template); do
[ "$(ls -A /var/www/${d})" ] || cp -R /template/${d}/* /var/www/${d}/

done

mkdir -pv /config/php/apache2.d
find /config/php/apache2.d -type f | while read file; do
ln -svf "${file}" "/etc/php/7.0/apache2/conf.d/$(basename "${file}")";
done;

sed -i "s/\/var\/www\/html/\/var\/www/g" /etc/apache2/sites-enabled/000-default.conf

chown -R www-data:www-data /var/www

if [ ! -z "${PIWIGO_MYSQL_ENGINE}" ]; then
grep -Rn MyISAM /var/www/install | cut -d: -f1 | sort -u | while read file; do
sed -i 's/MyISAM/InnoDB/' "${file}";
done;
fi;

source /etc/apache2/envvars
apache2ctl -D FOREGROUND

+ 1914
- 0
php.ini
File diff suppressed because it is too large
View File