bitpressio / docker-for-php-developers-errata

Reported errata for https://bitpress.io/docker-for-php-developers/
13 stars 0 forks source link

Chapter 6: Caddy in same container as FPM doesn't work #5

Closed zerodahero closed 6 years ago

zerodahero commented 6 years ago

In Chapter 6, the combining Caddy with the php:7.1-fpm image doesn't work. The latest documentation states that there can only be one CMD instruction and that the latest one will be the only one that takes effect (https://docs.docker.com/engine/reference/builder/#cmd). On docker v18.03, that's exactly what's happening--Caddy loads, but FPM does not.

Output:

Recreating ch6-caddy_app_1 ... done
Attaching to ch6-caddy_app_1
app_1  | Activating privacy features... done.
app_1  | http://0.0.0.0:2015
app_1  | 2018/07/16 13:46:01 http://0.0.0.0:2015
zerodahero commented 6 years ago

oops, lies, I see what's going on now, ignore this--I had a typo in my caddyfile

zerodahero commented 6 years ago

If anyone else runs into a similar thing, know that it's exactly right that we "override" the CMD instruction--it's Caddy that actually starts up php-fpm (on startup php-fpm --nodaemonize)

paulredmond commented 6 years ago

Thanks for your contribution and follow up comment 💖