Code Monkey home page Code Monkey logo

nginx-php-fpm-debian's Introduction

Introduction

This Dockerfile will build a container running nginx and php-fpm on debian using the debian style sites-available/sites-enabled. The Dockerfile is largely built on the file from ngineerd on github, which can be found here https://github.com/ngineered/nginx-php-fpm

Github

The source can be found here https://github.com/jimmikristensen/nginx-php-fpm-debian

Docker hub

The image can be found in the docker hub registry https://hub.docker.com/r/picster/nginx-php-fpm-debian/

Versions

  • Nginx: nginx/1.6.2
  • PHP: 5.6.17-0+deb8u1
  • Debian: GNU/Linux 8 (Jessie)

Starting the container

To start the container, run:

sudo docker run --name nginx -p 80:80 -d picster/nginx-php-fpm-debian

Access the site here http://<DOCKER_HOST>. The default site will be shown, which is a page displaying phpinfo();.

Volumes

Sometimes its desirable to mount certain directories to your docker host to create a permanent storage to to be able to manipulate files within the container. E.g. if you want to host multiple websites on a single container.

If you want to be able to upload new files to your website, mount the html dir /usr/share/nginx/html.

If you want to be able to be able to run multiple websites in a single container, mount the /etc/nginx/sites-available and /etc/nginx/sites-enabled.

The command for doing this:

sudo docker run --name nginx -p 80:80 -v /local-dir-on-host:/usr/share/nginx/html -v /local-dir-on-host:/etc/nginx/sites-available -v /local-dir-on-host:/etc/nginx/sites-enabled -d picster/nginx-php-fpm-debian

Please not that when creating the config symlink from sites-available to sites-enabled on the host, you should not use the absolute path but the relative path in order to keep the internal linking, i.e. standing i the sites-enabled dir on the host, you should do:

ln -s ../sites-available/myconfig myconfig

Logging

All access logs and error logs will be forwarded to docker log collector, which means you will be able to see the errors and access log using:

sudo docker logs <CONTAINER_ID>

nginx-php-fpm-debian's People

Contributors

jimmikristensen avatar

Stargazers

 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.