I’m teaching myself how Docker works by trying to configure Docker using a Compose to create a WordPress website using three containers: WordPress, MySQL, and abiosoft/caddy. I want to use Caddy to serve my site, but WordPress comes with Apache2 in its container by default. What would you say the best setup is for this?
-
Set up Caddy as a proxy server and get WordPress’ container (Apache) to send the data to Caddy and have Caddy send it to the user.
-
Bind volumes from WordPress to Caddy and have Caddy directly serve the files without any rerouting of data. I think this way would also require me to set up a way for Caddy’s container to have access to a php runtime.
I thought #1 sounded easier, but I couldn’t figure out how to bind the ports between containers like this. I could only bind container ports to the host ports.
I tried #2 as well, and I can’t seem to figure out how volumes
and volumes_from
work. Here are my docker-compose.yml and Caddyfiles.
Any help would be appreciated. Thanks!