This project is a simple container that demonstrates a Docker / PHP stack. It should allow people to get "something" up and running quickly.
- Docker
- docker-compose
- PHP
- MariaDB
Get the environment running:
docker-compose up --build
Test the connection:
curl https://localhost:5000
(or open a web browser to: https://localhost:5000):
Access MySQL:
docker exec -it db mysql
We start with the Docker image php:7.3-apache
. This container source code can be found here:
https://github.com/docker-library/php/blob/5992cb02fa5b3d76baffad60d94052a805958553/7.3/buster/apache/Dockerfile
docker-compose
is only used for local development. It allows us to have a complete environment for testing. It links up the src/
directory to /var/www/html/
inside the container. So you just need to save your code and can refresh the browser to pick up the changes.
/
- Index endpoint - Return a simple "Hello world"/error
- Error endpoint - Return a 404 error and log to server