Docker image to run PHP and Nginx
345
Docker image to run PHP and Nginx.
Pull the latest image from Docker hub.
docker pull thesuhu/docker-alpine-nginx-php:<version>
If you want to serve your web directly from host, just mount your web directory into container. Example:
docker run -itd -p 8080:80 --name myweb -v ~/myweb:/var/www/html thesuhu/docker-alpine-nginx-php:<version>
Or if you just want to try to see the PHP default configuration, run the following command and open the web through your browser.
docker run -itd -p 8080:80 --name myweb thesuhu/docker-alpine-nginx-php:<version>
If you have permission issue with your web directory, try to change the permission to 777 before running container.
chmod 777 -R myweb
Or you can build new image with your web files. Just create Dockerfile file and then build new image.
FROM thesuhu/docker-alpine-nginx-php:<version>
COPY myweb /var/www/html
The following version are available:
| Tag | Alpine | PHP | NGINX |
|---|---|---|---|
| Latest | 3.20.0 | 8.3.14 | 1.26.2 |
| 8.3 | 3.20.0 | 8.3.14 | 1.26.2 |
| 8.2 | 3.18.2 | 8.2.7 | 1.24.0 |
If you need another version, you can fork and edit the Dockerfile and then build for your own.
Content type
Image
Digest
sha256:93d1fdcd5…
Size
69.1 MB
Last updated
almost 2 years ago
docker pull thesuhu/docker-alpine-nginx-php