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 ## NGINX ## forked : https://git.sindominio.net/estibadores/nginx/src/branch/master/Dockerfile RUN apt install -qy nginx-full ssl-cert COPY config/nginx.wordpress.conf /etc/nginx/nginx.conf # Basic nginx directories RUN mkdir -p /var/lib/nginx/body && \ mkdir -p /var/lib/nginx/proxy && \ mkdir -p /var/lib/nginx/fastcgi && \ mkdir -p /var/lib/nginx/scgi && \ mkdir -p /var/lib/nginx/uwsgi && \ mkdir -p /var/lib/nginx/ssl/private && \ mkdir -p /var/lib/nginx/ssl/certs # Copy self-signed certs RUN cp /etc/ssl/private/ssl-cert-snakeoil.key /var/lib/nginx/ssl/private/ && \ cp /etc/ssl/certs/ssl-cert-snakeoil.pem /var/lib/nginx/ssl/certs/ RUN sed -i "s:/etc/ssl:/var/lib/nginx/ssl:g" /etc/nginx/snippets/snakeoil.conf # Logging to stdout RUN ln -sf /proc/self/fd /dev/ RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log # PID nginx for non-root users RUN mkdir -p /run/nginx && \ chmod 777 /run/nginx && \ chmod -R 777 /var/lib/nginx ADD wordpress /tmp/wordpress ADD entrypoint.sh /entrypoint.sh ADD start.sh /start.sh EXPOSE 9000 EXPOSE 443 EXPOSE 80 VOLUME /app ENTRYPOINT ["/bin/sh","/entrypoint.sh"] #CMD ["/usr/sbin/php-fpm","--nodaemonize","-O"] CMD ["/start.sh"]