Code Monkey home page Code Monkey logo

docker-for-local-development's Introduction

Docker for Building a Local Development Environment

This project provides a basic Docker setup, for building a local development environment for Zend Expressive, and other PHP, application development.

Why?

Why? Good question. But easy to answer. The intent is to provide a starting point for developers to get up and running quickly, using Docker, to build a local development environment. If you’d like much more background as to why, checkout this tutorial on Master Zend Framework. It lays out, much more comprehensively, the reasons why this is a good thing to do.

Installation

To get up and running, after cloning the repository:

  1. Install Docker. If you’re running a Linux distribution, use its package manager. If you’re using either macOS or Windows, download the respective Docker package installers: Docker for Mac or Docker for Windows.

  2. Add the cloned files to the root of a Zend Expressive (or other PHP) project.

  3. In docker/nginx/default.conf change the default document root setting, root /PATH/TO/YOUR/DOCUMENT/ROOT;, to suit your installation. More than likely, there will be a public/ directory in your source. So change the setting to be root /var/www/html/public;.

  4. Build the configuration by running: docker-compose up -d.

Check That Everything Is Working

To check that the build is working, run docker-compose ps. This should give you output similar to the below.

               Name                             Command             State               Ports
---------------------------------------------------------------------------------------------------------
dockerforlocaldevelopment_mysql_1     docker-entrypoint.sh mysqld   Up      3306/tcp
dockerforlocaldevelopment_nginx_1     nginx -g daemon off;          Up      443/tcp, 0.0.0.0:8080->80/tcp
dockerforlocaldevelopment_php_1       php-fpm                       Up      9000/tcp
dockerforlocaldevelopment_testing_1   php-fpm                       Up      9000/tcp

If you’d like to see more detailed information, check the log file by running docker-compose logs. To check that the files are inside the container, run the following command, substituting dockerforlocaldevelopment to match your directory name:

docker exec -it dockerforlocaldevelopment_nginx_1 ls -lahrt /var/www/html

Contributing

See the CONTRIBUTING file.

License

This project is licensed under the MIT License.

docker-for-local-development's People

Contributors

maltblue avatar mblkita avatar rawkode avatar settermjd avatar swoldanski 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.