Giter Club home page Giter Club logo

docker-compose-php7.4's Introduction

Docker Compose - Nginx, PHP 7.4-fpm, Postgres

A full docker compose setup for your PHP project for local development. Originally set up to work for Symfony 4+ projects, but can be tweaked to work in any PHP project. Thanks to https://github.com/ineat/docker-php-nginx-postgres-composer for pointing me in the right direction. I made some slight tweaks to use PHP 7.4-fpm easily and using Postgres for database.

Prerequisites

  • Docker v1.13.0+
  • Docker Compose (should come with Docker)

Installing Docker

Quick Guide:

  • Clone this into your project root folder
  • Go to .docker/nginx/default.conf and update the root folder AFTER /var/www/html (the public folder to access in browser, i.e. for Symfony it is "public", so /var/www/html/public)
  • Go to .docker/php/php.ini and add configuration specific to your project needs
  • Go to .docker/Dockerfile and on the same line as "install-php-extensions ...", add the extensions you need (list of available extensions here: https://github.com/mlocati/docker-php-extension-installer). You can also change the PHP version at the top. I set default to latest stable FPM. Currently only tested with PHP FPM.
  • Go to docker-compose.yaml and check all required services are enabled. I have added PG Admin, Redis, RabbitMQ and Mailcatcher but commented out. Uncomment if you want to use this
  • In terminal, "cd" to project root, and then run: docker-compose up -d
  • In your browser, go to localhost

TODO for this project

  • Add support for other databases
  • Show examples of using this in other popular PHP projects, such as Laravel, WordPress, etc

docker-compose-php7.4's People

Contributors

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