@@ -54,32 +54,32 @@ You can simply copy and paste one of these `docker run` commands to run a contai
5454
5555``` shell
5656# non-interactive
57- docker run --rm shinsenter/php:8.3-cli php -m
57+ docker run shinsenter/php:8.3-cli php -m
5858
5959# interactive
60- docker run -it --rm - v ./myproject:/var/www/html shinsenter/php:8.3-cli
60+ docker run -it -v ./myproject:/var/www/html shinsenter/php:8.3-cli
6161```
6262
6363#### PHP-FPM
6464
6565``` shell
66- docker run --rm - v ./myproject:/var/www/html -p 9000:9000 shinsenter/php:8.3-fpm
66+ docker run -v ./myproject:/var/www/html -p 9000:9000 shinsenter/php:8.3-fpm
6767```
6868
6969#### PHP-FPM + Nginx (or Apache, FrankenPHP, Nginx Unit)
7070
7171``` shell
7272# with Nginx
73- docker run --rm - v ./myproject:/var/www/html -p 80:80 -p 443:443 shinsenter/php:8.3-fpm-nginx
73+ docker run -v ./myproject:/var/www/html -p 80:80 -p 443:443 shinsenter/php:8.3-fpm-nginx
7474
7575# with Apache
76- docker run --rm - v ./myproject:/var/www/html -p 80:80 -p 443:443 shinsenter/php:8.3-fpm-apache
76+ docker run -v ./myproject:/var/www/html -p 80:80 -p 443:443 shinsenter/php:8.3-fpm-apache
7777
7878# with FrankenPHP
79- docker run --rm - v ./myproject:/var/www/html -p 80:80 -p 443:443 shinsenter/php:8.3-frankenphp
79+ docker run -v ./myproject:/var/www/html -p 80:80 -p 443:443 shinsenter/php:8.3-frankenphp
8080
8181# with Nginx Unit
82- docker run --rm - v ./myproject:/var/www/html -p 80:80 -p 443:443 shinsenter/php:8.3-unit-php
82+ docker run -v ./myproject:/var/www/html -p 80:80 -p 443:443 shinsenter/php:8.3-unit-php
8383```
8484
8585## Customizing Settings via Environment Variables
@@ -102,7 +102,7 @@ This naming convention helps you easily identify which environment variable appl
102102#### Command Line
103103
104104``` shell
105- docker run --rm \
105+ docker run \
106106 -v ./myproject:/var/www/html \
107107 -e PHP_DISPLAY_ERRORS=' 1' \
108108 -e PHP_POST_MAX_SIZE=' 100M' \
162162
163163> 👉🏻 Info: The pre-installed PHP extensions from the official Docker images are excluded from this list.
164164
165- > 💡 Hint: Run `docker run --rm shinsenter/php:8.3-cli php -m` in the container
165+ > 💡 Hint: Run `docker run shinsenter/php:8.3-cli php -m` in the container
166166to get a list of extensions (you can replace `8.3` with a specific PHP version).
167167
168168# # Adding PHP Extensions
@@ -193,7 +193,7 @@ have a look at [the install-php-extensions project](https://github.com/mlocati/d
193193The default application directory is `/var/www/html` and can be customized via the `$APP_PATH` environment variable :
194194
195195` ` ` shell
196- docker run --rm - p 80:80 -p 443:443 -p 443:443/udp \
196+ docker run -p 80:80 -p 443:443 -p 443:443/udp \
197197 -v "$PWD":/app \
198198 -e APP_PATH=/app \
199199 shinsenter/php:8.3-fpm-nginx
@@ -206,7 +206,7 @@ Moreover, the default document root
206206can be customized by setting the `$DOCUMENT_ROOT` environment variable :
207207
208208` ` ` shell
209- docker run --rm - p 80:80 -p 443:443 -p 443:443/udp \
209+ docker run -p 80:80 -p 443:443 -p 443:443/udp \
210210 -v "$PWD":/app \
211211 -e APP_PATH=/app \
212212 -e DOCUMENT_ROOT=/public \
@@ -234,7 +234,7 @@ The available variables are:
234234
235235For example, to run a container as the user `myapp` with uid `5000`, you could do :
236236` ` ` shell
237- docker run --rm - p 80:80 -p 443:443 -p 443:443/udp \
237+ docker run -p 80:80 -p 443:443 -p 443:443/udp \
238238 -e APP_USER=myapp \
239239 -e APP_UID=5000 \
240240 shinsenter/php:8.3-fpm-nginx
@@ -260,16 +260,19 @@ The autorun feature saves time by executing initialization scripts without manua
260260
261261# ### Usage
262262
263- For example, a script called `00-copy-config ` could be copied into `/startup/` via a Dockerfile.
263+ For example, a script called `00-migration ` could be copied into `/startup/` via a Dockerfile.
264264
265265> Note: The script file must have executable permissions to run.
266266
267267` ` ` Dockerfile
268268FROM shinsenter/php:8.3-cli
269269
270- ADD ./application /var/www/html
271- ADD ./autorun/00-copy-config /startup/00-copy-config
272- RUN chmod +x /startup/00-copy-config
270+ ADD ./autorun/00-migration /startup/00-migration
271+ RUN chmod +x /startup/00-migration
272+
273+ # You may add your constructions from here
274+ # For example:
275+ # ADD --chown=$APP_USER:$APP_GROUP ./myproject/ /var/www/html/
273276` ` `
274277
275278> 👉🏻 Info: The startup directory already includes a script called `99-greeting` that prints a welcome message when the container starts:
@@ -289,12 +292,12 @@ DockerHub: https://docker.shin.company/php
289292(To edit this welcome message, add your text to /etc/welcome.txt)
290293
291294----------------------------------------
292- Container : shinsenter/php
293- Distro : Alpine Linux v3.19
294- Timezone : UTC (GMT+0000)
295- UID / GID : www-data: www-data (82:82 )
296- App Root : /var/www/html
297- Document Root : /var/www/html/public
295+ Container : shinsenter/php
296+ Distro : Debian GNU/ Linux 12 (bookworm)
297+ Timezone : UTC (GMT+0000)
298+ UID / GID : www-data: www-data (33:33 )
299+ App Root : /var/www/html
300+ Document Root : /var/www/html
298301----------------------------------------
299302
300303PHP Docker Images (https://hub.docker.com/r/shinsenter/php )
@@ -307,11 +310,11 @@ but WITHOUT ANY WARRANTY. See the GNU GPL for more details.
307310
308311To get support, please contact: SHIN (@shinsenter )
309312
310- PHP 8.3.3 (fpm-fcgi ) (built: Feb 16 2024 23:20:45 )
313+ PHP 8.3.9 (cli ) (built: Jul 6 2024 00:42:01) (NTS )
311314Copyright (c) The PHP Group
312- Zend Engine v4.3.3 , Copyright (c) Zend Technologies
313- with Zend OPcache v8.3.3 , Copyright (c), by Zend Technologies
314- Composer version 2.7.1 2024-02-09 15:26:28
315+ Zend Engine v4.3.9 , Copyright (c) Zend Technologies
316+ with Zend OPcache v8.3.9 , Copyright (c), by Zend Technologies
317+ Composer version 2.7.7 2024-06-10 22:11:12
315318```
316319
317320#### Disable autorun scripts
@@ -320,7 +323,7 @@ To disable autorunning scripts, set the `DISABLE_AUTORUN_SCRIPTS` environment va
320323
321324For example, you can do this with `docker run`:
322325```shell
323- docker run --rm - e DISABLE_AUTORUN_SCRIPTS=1 shinsenter/php:8.3-fpm-nginx
326+ docker run -e DISABLE_AUTORUN_SCRIPTS=1 shinsenter/php:8.3-fpm-nginx
324327```
325328
326329Or in a ` docker-compose.yml ` :
@@ -344,7 +347,7 @@ This works both with `docker run` and in `docker-compose.yml`.
344347# ### Command Line
345348
346349` ` ` shell
347- docker run --rm - e DEBUG=1 shinsenter/php:8.3-fpm-nginx
350+ docker run -e DEBUG=1 shinsenter/php:8.3-fpm-nginx
348351` ` `
349352
350353# ### docker-compose.yml
0 commit comments