Now there's an additional thing I've added, as you see. Wait-for-it.sh db:3306 -strict -timeout=30 - php init.php & apache2ctl -D FOREGROUND Next, the final contents of my start.sh are: #!/bin/sh using apache2ctl instead of apache2 did the job (in apache2, apache's environment variables seemed to be unavailable). Was that I used the wrong command tool to run apache in the foreground. AH00111: Config variable $ is not defined This successfully executes the PHP script, but fails to execute the apache command, saying: I've tried to use to set this up via init.sh with the following contents: #!/bin/shĬMD But how can I make sure that the container keeps running and that the init.php script is simply launched to assured that the application has everything it needs, upon startup of the container? I know this is normal with Docker, as the container only persists as long as the CMD is running, according to the docs. My problem now is that the Docker container's execution always terminates with the successful execution of /src/init.php ( php-apache exited with code 0). The script src/init.php simply connects to the DB, and generates the tables that the application needs, if not already present. # apache config (rewrite rule to reroute all requests to unknown resources through to REST controller) php/conf.d/error_reporting.ini:/usr/local/etc/php/conf.d/error_reporting.ini php/conf.d/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini # setup xdebug to be able to use PHP step debugger, if needed RUN groupadd -r user & useradd -r -g user user I'm trying to run a Docker container based on:ĬOPY -from=composer:latest /usr/bin/composer /usr/bin/composer
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |