Commit d36636b6 authored by Fabio Montefuscolo's avatar Fabio Montefuscolo

adiciona hook na inicialização do container, antes de rodar o apache

parent 6196f2f5
......@@ -10,7 +10,7 @@ MAINTAINER Fabio Montefuscolo <fabio.montefuscolo@gmail.com>
RUN a2enmod rewrite expires ssl
# install the PHP extensions we need
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev && rm -rf /var/lib/apt/lists/* \
RUN apt-get update && apt-get install -y unzip libpng12-dev libjpeg-dev && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mysqli opcache
......@@ -25,11 +25,11 @@ RUN { \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
RUN curl -o wp-cli.phar 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar?0.23.0' \
RUN curl -o wp-cli.phar 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar?0.23.1' \
&& chmod +x wp-cli.phar \
&& mv wp-cli.phar /usr/local/bin/wp
RUN wp core download --path=/var/www/html/ --version=4.4.2 --allow-root
RUN wp core download --path=/var/www/html/ --version=4.5.3 --allow-root
COPY docker-entrypoint.sh /entrypoint.sh
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout localhost.key -out localhost.crt \
......@@ -37,6 +37,7 @@ RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout localhost.key -o
&& mv localhost.key /etc/ssl/private/localhost.key \
&& mv localhost.crt /etc/ssl/certs/localhost.crt
COPY default-ssl.conf /etc/apache2/sites-enabled
RUN mkdir -p /docker-entrypoint-extra/
EXPOSE 80 443
......
......@@ -3,6 +3,7 @@
keygen() {
cat /dev/urandom | tr -dc '[:print:]' | tr "\\\\" "-" | tr "'" "-" | head -c64;
}
PHP=`which php`
DB_USER="${WORDPRESS_DB_USER:=${MYSQL_ENV_MYSQL_USER:-root}}";
DB_NAME="${WORDPRESS_DB_NAME:=${MYSQL_ENV_MYSQL_DATABASE:-wordpress}}";
......@@ -112,4 +113,13 @@ php << EOF
}
EOF
for f in /docker-entrypoint-extra/*; do
case "$f" in
*.sh) echo "$0: running $f"; . "$f" ;;
*.php) echo "$0: running $f"; "${PHP}" < "$f"; echo ;;
*) echo "$0: ignoring $f" ;;
esac
echo
done
exec "$@"
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment