Giter Club home page Giter Club logo

docker-nginx-php-fpm's Introduction

Nginx, php-fpm and runit base image

Description

Out of the box, this image offers a working nginx and php-fpm webserver. This image is intended to allow to run a PHP application either passing a PHP application folder webroot as argument, either writing a Dockerfile with nasqueron/nginx-php-fpm image as base image.

Your web directory โ€” if you don't add vhosts โ€” is /var/wwwroot/default (mounted as volume).

The PHP last version is compiled through a build process borrowed from the official PHP Docker image, with this Dockerfile used.

We add common extensions like calendar, curl, gd, iconv, libxml, mbstring, mysqli, PDO MySQL and pcntl. The Pear, PECL executables and utilities (including build stuff like phpize) are available too.

Once running, you can quickly add PHP extensions to this image, with docker-php-ext-configure and docker-php-ext-install scripts.

Nginx is installed through the nginx-full Debian package. SSL is ready if needed at the container level (we expose ports 80 and 443).

Services are managed by runit in /var/service directory.

How to use it

To rebuild this image:

docker build --tag nasqueron/nginx-php-fpm .

To rebuild a fork of this image based on a modified Dockerfile:

docker build --tag your-image-name-tag .

To launch a container to execute a PHP application in /data/awesome-php-app with http://localhost:8080 as address:

docker run -d -v /data/awesome-php-app:/var/wwwroot/default -p 8080:80 nasqueron/nginx-php-fpm

To create an image for an application with this as base, create a Dockerfile:

FROM nasqueron/docker-nginx-php-fpm
# Debian commands to deploy your application code
# If you need other processes, add a /var/service/<service name>/run file

That's it.

How to upgrade this image?

As noted in https://devcentral.nasqueron.org/T787 we need to sync files and novolume/files.

For that, you can use our helper Makefile:

cd novolume
make update

docker-nginx-php-fpm's People

Contributors

dereckson avatar sandlayth avatar webspider 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.