Sign inSign up

synoa/php7-apache

By synoa

•Updated over 9 years ago

WIP: PHP7 and Apache Docker Image based on Alpine Linux.

Image
0

345

synoa/php7-apache repository overview

⁠docker.php7-apache

Alpine Linux based Docker Image with Apache and PHP 7

This image is a base Apache2 and PHP 7 image. It can be used to create pre-finished images like synoa/docker.magento2⁠.

⁠What you get
  • PHP 7.x
  • Apache 2.4
  • Alpine 3.5
⁠Usage
⁠Mount and Configuration

The default document root is in /var/www/localhost/htdocs so you will need to mount your PHP application into this directory. You can change the php.ini file by adding files to /etc/php7/conf.d OR by directly modifying the the php.ini file in /etc/php7/php.ini.

⁠Dockerfile

Build upon the image inside your Dockerfile, e.g. by providing Composer like so:

FROM synoa/php7-apache
LABEL maintainer Synoa GmbH <[email protected]>

# Install Phar
RUN apk update && \
    apk add --no-cache php7-phar

# Allow wget installs with SSL, see https://github.com/Yelp/dumb-init/issues/73#issuecomment-216069474
RUN apk add ca-certificates wget
RUN update-ca-certificates

# Install Composer
RUN cd /usr/local/bin && \
    wget https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar -O composer
RUN chmod +x /usr/local/bin/composer

# Add a composer alias
RUN echo "alias composer=\"php composer\"" >> /etc/profile.d/aliases.sh

ENTRYPOINT [ "httpd", "-D", "FOREGROUND" ]
⁠docker-compose

Since this image is ready to use directly it can be used inside a docker-compose.yml like so:

version: "2"

services:
  web:
    image: synoa/php7-apache
    ports:
      - "80:80"
    volumes:
      - ./app:/var/www/localhost/htdocs

Tag summary

Content type

Image

Digest

Size

27.4 MB

Last updated

over 9 years ago

docker pull synoa/php7-apache