- Dockerfile 56.2%
- Makefile 26.8%
- PHP 17%
| app | ||
| Dockerfile | ||
| env.list | ||
| Makefile | ||
| README.md | ||
PHP Docker Template
Description
This repo contains a template for building a PHP application that will run inside a docker container.
Usage
PHP code shoud be placed in the app/ directory. Once the image is built, this directory will be copied and renamed to /var/www/html inside the container. The apache server in the container will point to and serve this directory.
Some aspects of the build process, such as adding PHP extensions, can be changed by editing the env.list file.
All variables declared in the env.list file will also be available as environment variables in the container. Useful for passing database information and such.
Deployment
A Makefile is included to facilitate building and running the container. make build will build the image but will not run it. make run-test will build the image and launch it, attaching it to the current terminal.
The container will automatically remove itself once stopped, which can be done by entering Ctrl+C in the terminal that the container has attached to.
Access
The container binds to port 80 of the local host. Accessing the application therefor becomes as simple as opening http://localhost:80 in the URL bar of a web browser while the container is running.