Coder Social home page Coder Social logo

docker-php's Introduction

Docker PHP-FPM & Nginx on Alpine Linux

Docker setup for PHP applications using PHP-FPM and Nginx

Images used

Usage

Required development environment:

Configure the development environment on your local machine:

$ git clone https://github.com/t-hugo/docker-php.git
$ cd docker-php
$ make compose:up

You can now access the app: http://localhost:8080/.

Environment Variables

Nginx configuration

Variable Default value
PHP_UPSTREAM_CONTAINER php-fpm
PHP_UPSTREAM_PORT] 9000

Build arguments

Argument Default value
SERVER_NAME localhost
DOCUMENT_ROOT

Project tree

.
├── .docker
│   └── nginx
│       ├── Dockerfile
│       ├── docker-entrypoint.sh
│       ├── docker.conf
│       ├── include
│       │   ├── general.conf
│       │   ├── php_fastcgi.conf
│       │   └── security.conf
│       └── nginx.conf
├── .gitignore
├── Makefile
├── README.md
├── app
│   └── index.php
└── docker-compose.yml

Use Makefile

When developing, you can use Makefile for doing the following operations :

❯ make help                          
Usage: make <command>

Commands:
  help                           Provides help information on available commands
  compose/build                  Build all Docker images of the project
  compose/up                     Start all containers (in the background)
  compose/down                   Stops and deletes containers and networks created by "up".
  compose/restart                Restarts all containers
  compose/start                  Starts existing containers for a service
  compose/stop                   Stops containers without removing them
  compose/purge                  Stops and deletes containers, volumes, images (local) and networks created by "up".
  compose/purge/all              Stops and deletes containers, volumes, images (all) and networks created by "up".
  compose/rebuild                Rebuild the project
  compose/top                    Displays the running processes.
  compose/monitor                Display of container(s) resource usage statistics
  compose/monitor/follow         Display a live stream of container(s) resource usage statistics
  docker/urls                    Get project's URL

NOTE: the / is interchangable with the : in target names

docker-php's People

Contributors

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