This is an usefull extension of the official php:*-apache Docker image.
- GitHub: foorschtbar/php-webserver
- Docker Hub: foorschtbar/php-webserver
... compared to the official image:
- PHP extensions:
mysqli
,mysql_pdo
,imap
,soap
,imagick
andop_cache
- Apache Modules:
mod_rewrite
,mod_headers
,mod_remoteip
- Prepared for use behind a reverse proxy
Composer
Python 3
(with extra Docker tagpython
)
Tag | PHP Version | Branch | Python |
---|---|---|---|
latest |
8.3 | master | no |
python |
8.3 | master | yes |
develop |
8.3 | develop | no |
8.3 |
8.3 | master | no |
8.3-develop |
8.3 | develop | no |
8.3-python |
8.3 | master | yes |
8.3-python-develop |
8.3 | develop | yes |
Example docker-compose configuration:
version: "3"
services:
web:
image: foorschtbar/php-webserver
container_name: <changeme>-web
hostname: <changeme>
restart: unless-stopped
volumes:
- ./data/web:/var/www/html/public
environment:
- "UID=1000"
- "GID=1000"
labels:
- "com.centurylinklabs.watchtower.enable=true"
- "traefik.enable=true"
# Entrypoint and TLS
- "traefik.http.routers.<changeme>.entrypoints=https"
- "traefik.http.routers.<changeme>.rule=Host(`<changeme>`)"
- "traefik.http.routers.<changeme>.tls.certresolver=le"
# Loadbalancer
- "traefik.http.services.<changeme>.loadbalancer.server.scheme=http"
- "traefik.http.services.<changeme>.loadbalancer.server.port=80"
networks:
- internal
- reverse-proxy
depends_on:
- db
db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: unless-stopped
container_name: <changeme>-db
volumes:
- ./data/db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=<changeme>
- MYSQL_PASSWORD=<changeme>
- MYSQL_DATABASE=<changeme>
- MYSQL_USER=<changeme>
networks:
- internal
ports:
- 127.0.0.1:<changeme>:3306
labels:
- "com.centurylinklabs.watchtower.enable=true"
networks:
internal:
external: false
reverse-proxy:
external: true