https://github.com/jamesbrink/docker-php
Minimal PHP/Apache Docker image built on top of Alpine Linux.
https://github.com/jamesbrink/docker-php
alpine alpine-linux docker docker-image dockerfiles php php7
Last synced: 9 months ago
JSON representation
Minimal PHP/Apache Docker image built on top of Alpine Linux.
- Host: GitHub
- URL: https://github.com/jamesbrink/docker-php
- Owner: jamesbrink
- License: mit
- Created: 2018-03-24T11:33:29.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-22T22:58:10.000Z (over 7 years ago)
- Last Synced: 2025-03-25T20:33:05.995Z (about 1 year ago)
- Topics: alpine, alpine-linux, docker, docker-image, dockerfiles, php, php7
- Language: Shell
- Homepage:
- Size: 32.2 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Minimal PHP/Apache Docker image built on top of Alpine Linux.
[](https://travis-ci.org/jamesbrink/docker-php) [](https://hub.docker.com/r/jamesbrink/php/) [](https://hub.docker.com/r/jamesbrink/php/) [](https://hub.docker.com/r/jamesbrink/php/) [](https://microbadger.com/images/jamesbrink/php "Get your own image badge on microbadger.com") [](https://microbadger.com/images/jamesbrink/php "Get your own version badge on microbadger.com")
Available versions:
* `jamesbrink/php:latest` (80MB) - **PHP 7.2.3** ([Dockerfile][7.2/Dockerfile])
* `jamesbrink/php:7.1`(72MB) - **PHP 7.1.15** ([Dockerfile][7.1/Dockerfile])
* `jamesbrink/php:7.0` (71MB) - **PHP 7.0.28** ([Dockerfile][7.0/Dockerfile])
All images are based off of the official [Alpine Linux 3.7][Alpine Linux Image] image.
## About
For the most part I use nearly the identical build process as the official
[php:7-cli-alpine][official php-cli-alpine] images. I have including the `docker-php-*` helper scripts
that are included in the official images as well. The biggest difference is the inclusion of Apache 2.4
and compiling PHP against the packaged version of **pcre**.
Pull requests or suggestions are always welcome.
## Goals
The primary goal of this container is to stay small and light weight, yet still useful for general use/consumption.
This should serve as a solid base image and can be easily extended as I have done with my [Magento2 image][JamesBrink/Magento2] resulting in a very slim yet complete Magento 2 container.
## Usage Examples
Run exposing HTTP port 80.
This will serve up index.php at `http://localhost` that will printing out phpinfo.
```shell
docker run -p 80:80 jamesbrink/php
```
Use as a base image.
```Dockerfile
FROM jamesbrink/php:7.2
COPY ./MyApp /var/www/localhost/htdocs/
RUN apk add --update my-deps...
```
## Environment Variables
Environment Variables:
* APACHE_LOG_LEVEL - Default: "warn", adjusts the verbosity of the apache server
which by default prints to STDOUT. Refer to the [apache2 manual][apache2 manaual] for available LogLevels.
[Alpine Linux Image]: https://github.com/gliderlabs/docker-alpine
[7.2/Dockerfile]: https://github.com/jamesbrink/docker-magento/blob/master/7.2/Dockerfile
[7.1/Dockerfile]: https://github.com/jamesbrink/docker-magento/blob/master/7.1/Dockerfile
[7.0/Dockerfile]: https://github.com/jamesbrink/docker-magento/blob/master/7.0/Dockerfile
[official php-cli-alpine]: https://github.com/docker-library/php/blob/master/7.2/alpine3.7/cli/Dockerfile
[JamesBrink/Magento2]: https://github.com/jamesbrink/docker-magento
[apache2 manaual]: https://httpd.apache.org/docs/2.4/mod/core.html#loglevel