Lightweight container with Nginx 1.20 & PHP-FPM 8.0 based on Alpine Linux
8.3K
docker logs -f <container name>)
This image is built on GitHub actions and hosted on the GitHub Docker images repo. It is also available under khromov/alpine-nginx-php8 on Docker Hub.
Fetch the prebuilt image in your custom images:
GitHub (preferred):
docker pull ghcr.io/khromov/alpine-nginx-php8/alpine-nginx-php8:latest
If you get "no basic auth credentials", see this page.
Docker Hub:
docker pull khromov/alpine-nginx-php8
Not preferred since the image is not up to date due to Docker removing free build CI. PR welcome to add a GitHub action for pushing images to Docker Hub directly.
This is convenient for developing Laravel, WordPress or Drupal sites. It includes MySQL and phpMyAdmin
docker-compose up
Now you can access your site at http://localhost:8080 and the MySQL database at db:3306.
The folder ./src-compose will be created and you can put your project files there.
The urls are:
If you copied files into ./src-compose you need to run:
sudo chown -R nobody:nogroup ./src-compose
sudo chmod -R 777 ./src-compose
This makes sure that the files have the correct owner inside the container but remain writable outside of it.
docker build . -t php8
docker run -p 8080:8080 -t php8
Go to:
http://localhost:8080/
In config/ you'll find the default configuration files for Nginx, PHP and PHP-FPM. If you want to extend or customize that you can do so by mounting a configuration file in the correct folder.
This image was inspired by TrafeX/docker-php-nginx and this subsequent fork.
Content type
Image
Digest
sha256:84f9d6414…
Size
59.3 MB
Last updated
about 1 year ago
docker pull khromov/alpine-nginx-php8