This Docker template sets up an Nginx server with PHP processing capability. It is suitable for running PHP applications in a containerized environment with Nginx as the web server.
- Docker
- Docker Compose
- Clone this repository:
git clone https://github.com/InfraInnovator/DockerTemplate_Nginx-PHP.git
- Navigate to the cloned directory:
cd DockerTemplate_Nginx-PHP
- Run the reset.sh script to build and start the service:
./reset.sh
You can access the web application by going to http://localhost:8000. The default PHP page displays the PHP configuration info.
The Docker setup uses docker-compose.yml to orchestrate the Nginx and PHP containers. The Nginx configuration is defined in sites-available_default and can be adjusted as needed.
Place your PHP files in the nginx/html directory to have them served by Nginx. The Docker volume maps this directory to the Nginx container.
You can modify the Nginx configuration by altering the sites-available_default file and rebuilding the container.
Use the following commands to stop and remove containers, networks, and volumes:
docker-compose down