wordpress-audiolab/Dockerfile

50 lines
1.7 KiB
Docker
Raw Normal View History

FROM debian:stable-slim
ENV TZ=Europe/Madrid
ARG PHP_VERSION=8.1
RUN apt update && apt -y upgrade
RUN apt -y install lsb-release ca-certificates curl git
RUN curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
RUN sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
RUN apt-get update
RUN apt-get update && \
apt-get -qy install \
php${PHP_VERSION}-fpm php${PHP_VERSION}-mysql php${PHP_VERSION}-curl php${PHP_VERSION}-gd php${PHP_VERSION}-mbstring php${PHP_VERSION}-xml php${PHP_VERSION}-xmlrpc php${PHP_VERSION}-soap php${PHP_VERSION}-intl php${PHP_VERSION}-zip php${PHP_VERSION}-redis \
wget rsync sed curl tar ca-certificates less \
mariadb-client && \
apt-get clean
COPY config/php-fpm-wordpress.conf /tmp/www.conf
RUN cp /tmp/www.conf /etc/php/${PHP_VERSION}/fpm/pool.d/www.conf && \
ln -s /usr/sbin/php-fpm${PHP_VERSION} /usr/sbin/php-fpm && \
sed -i '/^error_log/cerror_log = /dev/stderr' /etc/php/${PHP_VERSION}/fpm/php-fpm.conf && \
sed -i '/^log_errors/clog_errors = Off' /etc/php/${PHP_VERSION}/fpm/php-fpm.conf && \
sed -i '/^pid/cpid = /tmp/php${PHP_VERSION}-fpm.pid' /etc/php/${PHP_VERSION}/fpm/php-fpm.conf
WORKDIR /app
RUN curl -s -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
chmod +x wp-cli.phar && \
mv wp-cli.phar /usr/local/bin/wp
WORKDIR /app/wordpress
RUN wp core download --allow-root
ADD wordpress /tmp/wordpress
ADD entrypoint.sh /entrypoint.sh
EXPOSE 9000
VOLUME /app
ENTRYPOINT ["/bin/sh","/entrypoint.sh"]
CMD ["/usr/sbin/php-fpm","--nodaemonize","-O"]