GithubHelp home page GithubHelp logo

docker-starter-pack's Introduction

Docker Starter Pack

This Docker Compose powered development environment includes:

  • PHP 7.2 FPM container with app, CLI tools, and Xdebug
  • Nginx web server, serving php app
  • MySQL database
  • Composer

Installation

Docker Platform can be installed on Windows, Mac, or Linux from their website. Once installed it will run as a background process, and the versions can be checked at the command line:

$ docker -v
$ docker-compose -v

Configuring the environment

The .env.dist file found in the root folder should be copied to .env, which is ignored by Git. The local web ports default to 8080 for the app.

# Copy default environment settings
$ cp .env.dist .env

This file contains an evolving set of options for database connections, web ports, Xdebug setttings to connect your IDE, and more to come.

Environment Status

You can list running containers by running the docker-compose ps command.

Name Command State Ports
nginx nginx Up 443/tcp, 0.0.0.0:80->80/tcp
php-fpm php-fpm Up 0.0.0.0:9000->9000/tcp
mysql docker-entrypoint.sh mysqld Up 0.0.0.0:3307->3306/tcp
composer /docker-entrypoint.sh comp ... Exit 0

What's Running?

PHP

PHP 7.2 FPM, based on the official php:7.2-fpm image. The following system-wide tools are included in addition to the base packages:

  • Composer
  • GIT
  • VIM
  • etc

Additionally, PHP includes following extensions:

  • Opcache
  • MySQL
  • etc

Nginx

Nginx 1.7 is installed with apt-get on the debian:jessie base image.

Composer

Composer is a dependency manager written in and for PHP. It runs composer install on each container building.

Running composer command (e.g. composer update):

$ docker-compose run --rm --user $(id -u):$(id -g) --entrypoint "composer update" composer

Misc commands

# Stop and remove all containers
$ docker stop $(docker ps -a -q)
$ docker rm $(docker ps -a -q)

# Delete all images
$ docker rmi $(docker images -q)

# Remove unused data
$ docker system prune

How to run tests inside container?

docker-compose run --rm --entrypoint "./vendor/bin/simple-phpunit" app

docker-starter-pack's People

Watchers

 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.