Basic image with Apache & PHP 8.1 based on Alpine 3.17
docker pull martinbouillaud/apache-php:latest
SERVER_ADMIN
(a server admin, defaults to[email protected]
)HTTP_SERVER_NAME
(a server name, defaults towww.example.com
)LOG_LEVEL
(a log level, defaults toinfo
)TZ
(a timezone, defaults toUTC
)PHP_MEMORY_LIMIT
(a memory-limit, defaults to256M
)PHP_UPLOAD_MAX_FILESIZE
(a upload_max_filesize, defaults to8M
)PHP_POST_MAX_SIZE
(a post_max_size, defaults to8M
)
/htdocs
default docroot inside this container
Replace apache-php and tags with whatever you want when building your own image.
docker build -t apache-php:latest .
docker run -d --name apache-php -v /opt/myapp:/htdocs -p 80:80 martinbouillaud/apache-php:latest
docker run -d \
--name apache-php \
-e HTTP_SERVER_NAME="www.example.xyz" \
-e TZ="Europe/Paris" \
-e PHP_MEMORY_LIMIT="512M" \
-v /opt/myapp:/htdocs \
--publish 80:80 \
--restart unless-stopped \
martinbouillaud/apache-php:latest
version: "3.3"
apache-php:
container_name: apache-php
image: martinbouillaud/apache-php:latest
ports:
- "8080:80"
environment:
- HTTP_SERVER_NAME=apache-php.example.com
- TZ=Europe/Paris
- PHP_MEMORY_LIMIT=1024M
volumes:
- /opt/myapp:/htdocs