https://github.com/alfg/docker-php-apache
A Dockerfile installing Apache 2.4, mod_php with a default settings template. Built on Alpine Linux.
https://github.com/alfg/docker-php-apache
apache docker php php7
Last synced: over 1 year ago
JSON representation
A Dockerfile installing Apache 2.4, mod_php with a default settings template. Built on Alpine Linux.
- Host: GitHub
- URL: https://github.com/alfg/docker-php-apache
- Owner: alfg
- License: mit
- Created: 2018-08-26T06:58:41.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-08-25T08:40:00.000Z (almost 7 years ago)
- Last Synced: 2025-03-22T17:02:04.232Z (over 1 year ago)
- Topics: apache, docker, php, php7
- Language: Dockerfile
- Homepage: https://github.com/alfg/docker-php-apache
- Size: 34.2 KB
- Stars: 5
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Docker PHP Apache
A Dockerfile installing Apache 2.4, mod_php with a default settings template. Built on Alpine Linux for a small footprint ~26MB.
Use this as a template for serving PHP applications on Apache.
[](https://hub.docker.com/r/alfg/php-apache/)
[](https://hub.docker.com/r/alfg/php-apache/)
[](https://hub.docker.com/r/alfg/php-apache/builds/)
[](https://travis-ci.org/alfg/docker-php-apache)
## Usage
* Pull docker image and run:
```
docker pull alfg/php-apache
docker run -it -p 8080:80 --rm alfg/php-apache
```
* or build and run container from source:
```
docker build -t php-apache
docker run -it -p 8080:80 --rm php-apache
```
* or build using `docker-compose`:
```
docker-compose build
docker-compose up
```
```
$ curl -I localhost:8080/info.php
HTTP/1.1 200 OK
Date: Mon, 27 Aug 2018 00:18:27 GMT
Server: Apache/2.4.34 (Unix)
X-Powered-By: PHP/7.2.8
Content-Type: text/html; charset=UTF-8
```
## Configure
Apache and PHP default configurations are included in the [etc](/etc) directory. You can override the configurations and these will be copied over into the container.
Also see [etc/apache2/sites/](/etc/apache2/sites) for adding or editing virtual hosts.
## Resources
* https://httpd.apache.org/docs/2.4/