Custom nginx container exits immediately when part of docker-compose

The CMD in your Dockerfile should start a process which needs to run in foreground. The command service nginx start runs the process in deamon mode and thus your container exits cleanly because the service command exits.

Use the following CMD ["nginx", "-g", "daemon off;"] to start nginx (taken from official image) and it should work correctly.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)