GithubHelp home page GithubHelp logo

cwonrails / alpine-php-wordpress Goto Github PK

View Code? Open in Web Editor NEW

This project forked from etopian/alpine-php-wordpress

0.0 2.0 0.0 42 KB

Lightwight Docker image for the (latest) PHP-FPM and Nginx for WordPress

Home Page: http://www.dockerwordpress.com

PHP 4.04% Nginx 90.03% Shell 5.93%

alpine-php-wordpress's Introduction

This image is being maintained. No need to fork it. Upgrade your site using the upgrade strategy on dockerwordpress.com

http://www.dockerwordpress.com/docker/upgrading-wordpress-docker

Lightweight WordPress PHP7 PHP-FPM7 & Nginx Docker Image

Lightwight Docker image for the (latest) PHP-FPM and Nginx to run WordPress based on AlpineLinux

  • Image size only ~131MB !
  • Very new packages (alpine:edge) 2016-07-21:
    • PHP 7.0.8
    • Nginx 1.10.1
    • Memory usage is around 50mb on a simple install.

A simple example

Say you want to run a single site on a VPS with Docker

mkdir -p /data/sites/etopian.com/htdocs

sudo docker run -e VIRTUAL_HOST=etopian.com,www.etopian.com -v /data/sites/etopian.com:/DATA -p 80:80 etopian/alpine-php-wordpress

The following user and group id are used, the files should be set to this: User ID: Group ID:

chown -R 100:101 /data/sites/etopian.com/htdocs

Say you want to run a multiple WP sites on a VPS with Docker

sudo docker run -p 80:80 etopian/nginx-proxy
mkdir -p /data/sites/etopian.com/htdocs

sudo docker run -e VIRTUAL_HOST=etopian.com,www.etopian.com -v /data/sites/etopian.com:/DATA etopian/alpine-php-wordpress

mkdir -p /data/sites/etopian.net/htdocs
sudo docker run -e VIRTUAL_HOST=etopian.net,www.etopian.net -v /data/sites/etopian.net:/DATA etopian/alpine-php-wordpress

Populate /data/sites/etopian.com/htdocs and /data/sites/etopian.net/htdocs with your WP files. See http://www.dockerwordpress.com if you need help on how to configure your database.

The following user and group id are used, the files should be set to this: User ID: Group ID:

chown -R 100:101 /data/sites/etopian.com/htdocs

Volume structure

  • htdocs: Webroot
  • logs: Nginx/PHP error logs

WP-CLI

This image now includes WP-CLI wpcli.org baked in... So you can. Please su nginx before executing or else you can potentially compromise your host.

docker exec -it <container_name> bash
su nginx
cd /DATA/htdocs
wp-cli cli

Fail2Ban

We are adding the ability to use Fail2Ban on here, however it does not yet work. Will update once it does.

Multisite

For each multisite you need to give the domain as the -e VIRTUAL_HOST parameter. For instance VIRTUAL_HOST=site1.com,www.site1.com,site2.com,www.site2.com ... if you wish to add more sites you need to recreate the container.

Upload limit

The upload limit is 2 gigabyte.

Change php.ini value

modify files/php-fpm.conf

To modify php.ini variable, simply edit php-fpm.ini and add php_flag[variable] = value.

php_flag[display_errors] = on

PHP Modules

List of available modules in Alpine Linux, not all these are installed.

In order to install a php module do, (leave out the version number i.e. -5.6.11-r0
docker exec <image_id> apk add <pkg_name>
docker restart <image_name>

Example:

docker exec <image_id> apk add php-soap
docker restart <image_name>

php-soap-5.6.11-r0

php-openssl-5.6.11-r0

php-gmp-5.6.11-r0

php-phar-5.6.11-r0

php-embed-5.6.11-r0

php-pdo_odbc-5.6.11-r0

php-mysqli-5.6.11-r0

php-common-5.6.11-r0

php-ctype-5.6.11-r0

php-fpm-5.6.11-r0

php-shmop-5.6.11-r0

php-xsl-5.6.11-r0

php-curl-5.6.11-r0

php-pear-net_idna2-0.1.1-r0

php-json-5.6.11-r0

php-dom-5.6.11-r0

php-pspell-5.6.11-r0

php-sockets-5.6.11-r0

php-pear-mdb2-driver-pgsql-2.5.0b5-r0

php-pdo-5.6.11-r0

phpldapadmin-1.2.3-r3

php-pear-5.6.11-r0

php-phpmailer-5.2.0-r0

phpmyadmin-doc-4.4.10-r0

php-cli-5.6.11-r0

php-zip-5.6.11-r0

php-pgsql-5.6.11-r0

php-sysvshm-5.6.11-r0

php-imap-5.6.11-r0

php-intl-5.6.11-r0

php-embed-5.6.11-r0

php-zlib-5.6.11-r0

php-phpdbg-5.6.11-r0

php-sysvsem-5.6.11-r0

phpmyadmin-4.4.10-r0

php-mysql-5.6.11-r0

php-sqlite3-5.6.11-r0

php-cgi-5.6.11-r0

php-apcu-4.0.7-r1

php-snmp-5.6.11-r0

php-pdo_pgsql-5.6.11-r0

php-xml-5.6.11-r0

php-wddx-5.6.11-r0

php-sysvmsg-5.6.11-r0

php-enchant-5.6.11-r0

php-bcmath-5.6.11-r0

php-pear-mail_mime-1.8.9-r0

php-apache2-5.6.11-r0

php-gd-5.6.11-r0

php-pear-mdb2-driver-sqlite-2.5.0b5-r0

php-xcache-3.2.0-r1

php-odbc-5.6.11-r0

php-mailparse-2.1.6-r2

php-ftp-5.6.11-r0

perl-php-serialization-0.34-r1

php-exif-5.6.11-r0

php-pdo_mysql-5.6.11-r0

php-ldap-5.6.11-r0

php-pear-mdb2-2.5.0b5-r0

php-dbg-5.6.11-r0

php-pear-net_smtp-1.6.2-r0

php-opcache-5.6.11-r0

php-pdo_sqlite-5.6.11-r0

php-posix-5.6.11-r0

php-dba-5.6.11-r0

php-iconv-5.6.11-r0

php-gettext-5.6.11-r0

php-xmlreader-5.6.11-r0

php-5.6.11-r0

php-xmlrpc-5.6.11-r0

php-bz2-5.6.11-r0

perl-php-serialization-doc-0.34-r1

php-mcrypt-5.6.11-r0

php-memcache-3.0.8-r3

xapian-bindings-php-1.2.21-r1

php-pdo_dblib-5.6.11-r0

php-phalcon-2.0.3-r0

php-dev-5.6.11-r0

php-doc-5.6.11-r0

php-mssql-5.6.11-r0

php-calendar-5.6.11-r0

php-pear-mdb2-driver-mysqli-2.5.0b5-r0

php-pear-mdb2-driver-mysql-2.5.0b5-r0

alpine-php-wordpress's People

Contributors

cwonrails avatar etopian avatar petrozavodsky avatar psi-4ward avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.