Skip to content

This is an usefull extension of the official php:*-apache Docker image.

License

Notifications You must be signed in to change notification settings

foorschtbar/php-webserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-webserver - A PHP Webserver

This is an usefull extension of the official php:*-apache Docker image.

Improvements

... compared to the official image:

  • PHP extensions: mysqli, mysql_pdo, imap, soap, imagick and op_cache
  • Apache Modules: mod_rewrite, mod_headers, mod_remoteip
  • Prepared for use behind a reverse proxy
  • Composer
  • Python 3 (with extra Docker tag python)

Tags and Versions

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

Usage

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

About

This is an usefull extension of the official php:*-apache Docker image.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published