Skip to content

Latest commit

 

History

History
70 lines (53 loc) · 2.63 KB

README.md

File metadata and controls

70 lines (53 loc) · 2.63 KB

Basic docker Apache PHP

Basic image with Apache & PHP 8.1 based on Alpine 3.17

Maintenance Docker Pulls Docker Image Size Github last-commit Build & Push

Docker Image Utilization

docker pull martinbouillaud/apache-php:latest

Environnement variables

Volumes

  • /htdocs default docroot inside this container

Build

Replace apache-php and tags with whatever you want when building your own image.

docker build -t apache-php:latest .

Run

docker run -d --name apache-php -v /opt/myapp:/htdocs -p 80:80 martinbouillaud/apache-php:latest

Customized run

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

Docker-compose Stack

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