this post was submitted on 19 Jun 2023
5 points (100.0% liked)

Selfhosted

39532 readers
455 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Hi, some bot for some reason really needs to scrape my wordpress blog over and over again, overheating my poor celeron.

For laziness I am just using the default wordpress docker image, which is php+apache.

I did some experiments and with php-fpm+caddy it's much faster.

Now i want to migrate all my wordpress blogs, five in total and I want to manage them from a single caddy instance.

php-fpm needs to be mounted in the same path or it can be different?

For example, the wordpress install places the files in /var/www/html, and so for Caddy I mount in the same path and in the Caddyfile i have:

test.example.com{
        root * /var/www/html
        php_fastcgi wordpress:9000
        file_server
}

if i have multiple installs can I mount different paths like /var/www/html2 and so on (but only on caddy) or it must match both containers?

you are viewing a single comment's thread
view the rest of the comments
[–] polaris64 2 points 1 year ago

I use Caddy in production with a PHP-FPM WordPress Docker container in the same way as you describe. I have the site root mounted as a volume on to Caddy container at /var/www/html and mounted in the WordPress PHP-FPM container under a separate path. In my Caddyfile I use the root directive as you've shown but then override it under the php_fastcgi directive to match the path in the WordPress container.