Giter VIP home page Giter VIP logo

docker-nginx-php-stack's Introduction

Base docker image with NGINX and PHP

Base docker image with NGINX and PHP7-FPM used by atoto.cz

Installed tools

  • Based on Debian 8.5 (jessie)
  • PHP 7, php-fpm with extensions mongodb, bcmath, mbstring, intl, iconv, mcrypt, zip...
  • NGINX
  • Supervisor
  • GIT
  • Composer

How to use this image as a base php image

  • Copy sources of your application to /var/www/html
  • All HTTP requests will be routed to /var/www/html/web/app.php
  • Update Dockerfile:
FROM atoto/docker-nginx-php-stack:latest

# install dependencies
RUN composer config -g github-oauth.github.com abcdef1021992sdmksmkskm
COPY composer.json composer.lock /var/www/html/
RUN composer install --no-dev --optimize-autoloader

# copy sources to container
ADD . /var/www/html

# create necessary files and directories, set permissions
RUN rm -fr var/* && \
    mkdir -p var var/logs var/temp var/cache && \
    chown -R www-data:www-data /var/www/* && \
    chmod -R 777 var/* && \
    bin/console  doctrine:mongodb:generate:proxies
    # ...

# start container as a non-root user
USER www-data
  • NGIX will be listening on port 8080
  • If you would like to run some commands on container start (migrate database etc.), just create file called docker-run.sh in your project root or in .docker directory:
# contents of file docker-run.sh

bin/console monitoring:mapping
bin/console doctrine:mongodb:schema:update
# ...
  • If you would like to add something to supervisor configuration (consumers etc.), create file called supervisord.conf in your project root or in .docker directory:
# contents of file supervisord.conf

[program:product-sync]
command=bin/console r:c -w -m 100 products-sync

[program:another]
command=bin/console another:command
  • You can define crontab which will be used to run cron jobs inside container (you must be root):
# contents of file crontab

* * * * * echo "Hello world every minute"

docker-nginx-php-stack's People

Contributors

hunaczech avatar ludekvesely avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.