To get the application up and running, follow these steps:
Clone this repository to your local machine using Git:
git clone <repository-url>
cd <repository-directory>
Replace <repository-url>
with the URL of this Git repository, and <repository-directory>
with the name of the directory into which the repository was cloned.
From the root directory of the cloned repository, build the Docker image using the following command:
docker build -t php-app .
This command builds a Docker image named php-app
based on the instructions in the Dockerfile
.
Once the image is built, you can run the container using:
docker run -it --rm php-app
The Docker setup provided in this repository is based on PHP 7.0 CLI. However, you might want to run the application using a different version of PHP for testing.
The official PHP images on Docker Hub support various versions and configurations. You can find a list of available PHP images and tags here: Official PHP Docker Images.
- Open the
Dockerfile
in your favorite text editor. - Change the
FROM
line to specify a different PHP version. For example, to use PHP 8.0 CLI, change the line to:
FROM php:8.0-cli
- Rebuild the application and run the container.
docker build -t php-app .
docker run -it --rm php-app