2017 © Pedro Peláez
 

project docker_php_mysql

A basic docker container setup for your application

image

svenfinke/docker_php_mysql

A basic docker container setup for your application

  • Tuesday, February 27, 2018
  • by svenfinke
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • Shell
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Default development stack with docker

This package is supposed to provide you with a basic setup to develop your php application with docker. Just install it with composer require svenfinke/docker_php_mysql --dev and start the container with vendor/bin/docker_start.sh, (*1)

Parameters

The docker setup is automatically loading the .env file from your project root. This way you can easily set any Composer CLI parameters that would be set with environment variables. You can also configure the Database with the following parameters:, (*2)

  • MYSQL_ROOT_PASSWORD
  • MYSQL_DATABASE
  • MYSQL_USER
  • MYSQL_PASSWORD

The ports which are exposed to the host can be configured with this variables:, (*3)

  • HOST_WEBSERVER_PORT
  • HOST_MYSQL_PORT

Ports are being used to ensure that Mac is also supported., (*4)

Managing the containers

There are a few scripts to start/stop the containers:, (*5)

  • docker_start.sh
  • docker_stop.sh
  • docker_remove.sh

All the scripts are located at vendor/bin. They should be quite self-explaining. Stop is really using stop, so if you want to remove the containers, call the remove script., (*6)

Additional Scripts

Sometimes you want to SSH into the machine or run some scripts on it. There are 2 ways of doing this: docker_ssh.sh will run shell on the php-fpm machine. The other, more flexible, way is to use docker_exec.ssh php-fpm sh. This command would be the equivalent to docker_ssh.sh, but you could also run e.g. docker_exec.ssh php-fpm 'bin/console doctrine:migrations:migrate' if you are running a symfony application., (*7)

The Versions

27/02 2018

dev-master

9999999-dev

A basic docker container setup for your application

  Sources   Download

by Sven Finke

27/02 2018

0.1.0

0.1.0.0

A basic docker container setup for your application

  Sources   Download

by Sven Finke