How to write dockerfile so that when nginx,php-fpm,run has a container, you can start it yourself.

based on the first basic image, the dockerfile,docker run without the first basic image has a container, as shown in the following figure

for the nginx service in the container, the php-fpm service does not start by itself. Can you let it start by itself through the second image of build? how should dockerfile be written? hope the gods will show their support

.

the name of the basic image is: ubuntu-api-pworks:1.0.0

Mar.23,2021

generally speaking, it is better to separate nginx/php, and it is also convenient to expand. If you want to start at the same time, writing dockerfile is only basic. You need to add docker-compose configuration startup command, and finally execute

.
-sharp entrypoint.sh

-sharp 1php-fpm daemon
-sharp 2nginx daemon

then execute [/ bin/bash', 'entrypoint.sh'] directly in cmd or entrypoint of dockerfile. Pay attention to the script path

Menu