Public | Automated Build

Last pushed: a year ago
Short Description
Lightwight Docker image for the (latest) PHP-FPM and Nginx based on AlpineLinux
Full Description

PHP-FPM & Nginx Docker Image

Lightwight Docker image for the PHP-FPM and Nginx based on AlpineLinux

Features

  • Image size only ~100MB !
  • Very new packages (alpine:edge):
  • Additional PHP Packages included
  • Custom init support
  • Nginx Access logs
  • Use Unix socket for php-fpm, Security and Performance
  • cgi.fix_pathinfo Disabled for Additional Security

Usage

Quick start

sudo docker run -v ./data:/data -p 80:80 pooya/php-nginx

Docker Compose example

version: '2'
services:
  www:
    image: pooya/php-nginx
    volumes:
      - ./data:/data
    environment:
      -  VIRTUAL_HOST=<Hostname>
      -  LETSENCRYPT_HOST=<Hostname>
      -  LETSENCRYPT_EMAIL=<Email>
    network_mode: "bridge"
    mem_limit: 256m
    restart: always

Extra Init Script

You can do additional steps before running container

Example: installing fortune package from testing repository

  • Create init file: touch data/init && chmod +x data/init
  • Edit data/init
if ! [ -x "$(command -v fortune)" ]; then
  echo "Installing fortune"
  apk add fortune --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
  rm -rf /var/cache/apk/*
fi

Volume structure

  • data/htdocs: Webroot
  • data/logs: Nginx/PHP-FPM error log
  • [optional] data/init: additional init script
Docker Pull Command
Owner
pooya
Source Repository

Comments (0)