Skip to content

Docker image Apache-PHP

Notifications You must be signed in to change notification settings

bilyboy785/docker-apache-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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