Created
February 29, 2024 04:48
-
-
Save qolarnix/1b7afa5a71d83de65b77e31bdfd25ebf to your computer and use it in GitHub Desktop.
Dockerfile for frankenphp local wp
This file contains hidden or 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 dunglas/frankenphp:latest-php8.2 | |
# install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions) | |
RUN install-php-extensions \ | |
bcmath \ | |
exif \ | |
gd \ | |
intl \ | |
mysqli \ | |
zip \ | |
imagick \ | |
opcache | |
COPY --from=wordpress /usr/local/etc/php/conf.d/* /usr/local/etc/php/conf.d/ | |
COPY --from=wordpress /usr/local/bin/docker-entrypoint.sh /usr/local/bin/ | |
COPY --from=wordpress --chown=root:root /usr/src/wordpress /usr/src/wordpress | |
WORKDIR /var/www/html | |
VOLUME /var/www/html | |
RUN cp $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini | |
RUN sed -i 's/upload_max_filesize = .*/upload_max_filesize = 256M/' $PHP_INI_DIR/php.ini \ | |
&& sed -i 's/post_max_size = .*/post_max_size = 256M/' $PHP_INI_DIR/php.ini | |
USER root | |
RUN ln -s /app/private/projects/simpledmca/theme/sdm-theme /var/www/html/wp-content/themes/sdm-theme | |
USER www-data | |
ARG USER=www-data | |
RUN chown -R ${USER}:${USER} /data/caddy && chown -R ${USER}:${USER} /config/caddy | |
RUN sed -i \ | |
-e 's/\[ "$1" = '\''php-fpm'\'' \]/\[\[ "$1" == frankenphp* \]\]/g' \ | |
-e 's/php-fpm/frankenphp/g' \ | |
/usr/local/bin/docker-entrypoint.sh | |
RUN sed -i \ | |
-e 's#root \* public/#root \* /var/www/html/#g' \ | |
/etc/caddy/Caddyfile | |
USER ${USER} | |
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] | |
CMD ["frankenphp", "run", "--config", "/etc/caddy/Caddyfile"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Edits to docker-compose.yml
volumes:
- wordpress:/var/www/html
- /home/polarnix/Git:/app/private
tty: true