Skip to content

A Docker image with PHP, Apache (running in Foreground) serving from public/ folder.

Notifications You must be signed in to change notification settings

luizinlara/docker-php-apache

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker pull socialengine/apache-php

This is a Docker image with PHP, Composer, and Apache (running in Foreground) serving from public/ folder. Ideal for Laravel, Lumen and other modern php apps.

Supported tags and Dockerfile links

Included on top of base PHP image

  • mbstring
  • mcrypt
  • zip
  • composer (avaiable globally)
  • xdebug (enabled with -e PHP_XDEBUG=1)

App Setup

This docker image is built for index.php file being in the public/ directory. mod_rewrite is enabled.

At a minimum, you will want this in your Dockerfile:

FROM socialengine/php-apache:5.6

COPY . /app

RUN composer install

Then you can build & run your app in the docker container.

If you want to enable xdebug:

$ docker run -e PHP_XDEBUG=1 [your image]

See example for further info.

Check Links

A lot of times, your depedant services aren't ready to go as fast as your app

For that, there's a check_docker_link command that will check TCP to make sure its up

Usage: check_docker_link <name> <addr> <port>

# Example
if check_docker_link "mysql" "${DB_1_PORT_3306_TCP_ADDR}" "${DB_1_PORT_3306_TCP_PORT}"; then
    export MYSQL_HOST=${DB_1_PORT_3306_TCP_ADDR}
    export MYSQL_PORT=${DB_1_PORT_3306_TCP_PORT}
fi

About

A Docker image with PHP, Apache (running in Foreground) serving from public/ folder.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 77.9%
  • Dockerfile 22.0%
  • PHP 0.1%