From 3b37f2121a9b81381620c497f4a75a15c887eb1b Mon Sep 17 00:00:00 2001 From: Chris Tankersley Date: Thu, 22 Mar 2018 23:11:09 -0400 Subject: [PATCH] Removed vagrant and replaced with Docker --- README.md | 48 ++---- Vagrantfile | 17 -- app/config/parameters.yml.dist | 10 +- cb | 12 ++ composer.lock | 163 +++++++++--------- docker-compose.yml | 18 ++ docker/httpd/Dockerfile | 11 ++ docker/php/Dockerfile | 7 + vagrant/puppet/manifests/base.pp | 19 -- .../modules/apache2/files/local.dev.crt | 18 -- .../puppet/modules/apache2/manifests/init.pp | 39 ----- .../apache2/templates/enablesendfile.conf.erb | 1 - .../modules/apache2/templates/vhost.conf.erb | 29 ---- vagrant/puppet/modules/php/files/custom.ini | 1 - vagrant/puppet/modules/php/files/xdebug.ini | 6 - vagrant/puppet/modules/php/manifests/init.pp | 29 ---- vagrant/shell/puppet.sh | 5 - 17 files changed, 152 insertions(+), 281 deletions(-) delete mode 100644 Vagrantfile create mode 100755 cb create mode 100644 docker-compose.yml create mode 100644 docker/httpd/Dockerfile create mode 100644 docker/php/Dockerfile delete mode 100644 vagrant/puppet/manifests/base.pp delete mode 100644 vagrant/puppet/modules/apache2/files/local.dev.crt delete mode 100644 vagrant/puppet/modules/apache2/manifests/init.pp delete mode 100644 vagrant/puppet/modules/apache2/templates/enablesendfile.conf.erb delete mode 100644 vagrant/puppet/modules/apache2/templates/vhost.conf.erb delete mode 100644 vagrant/puppet/modules/php/files/custom.ini delete mode 100644 vagrant/puppet/modules/php/files/xdebug.ini delete mode 100644 vagrant/puppet/modules/php/manifests/init.pp delete mode 100644 vagrant/shell/puppet.sh diff --git a/README.md b/README.md index cc482e9..0597dfe 100644 --- a/README.md +++ b/README.md @@ -10,30 +10,21 @@ You should have [Composer](http://getcomposer.org) installed and available. If y ### Setup -#### Using Vagrant +#### Using Docker 1. Clone this repo. -2. Go into the folder, and run `vagrant up` to start the VM. -3. Add the following entry to your hosts file: +2. Go into the folder, and run `docker-compose up -d` to build and run the images +3. Add the following entry to your hosts file. On unix-like systems, its usually found at `/etc/hosts`: - 192.168.56.101 www.mentoring.dev mentoring.dev - -4. Run `vagrant ssh` to go into the VM. -5. Change directory to `/var/www` and run `composer install` - - If you get an error like the following: - - Could not fetch https://api.github.com/repos/vlucas/phpdotenv/zipball/732d2adb7d916c9593b9d58c3b0d9ebefead07aa, please create a GitHub OAuth token to go over the API rate limit - Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+packer-virtualbox-iso-1422588891+2015-05-22+0002 to retrieve a token. - It will be stored in "/home/vagrant/.composer/auth.json" for future use by Composer. + 127.0.0.1 www.mentoring.dev mentoring.dev - You will need to navigate to the URL in a browser, authenticate with GitHub, and generate the access token. - +4. Run `chmod +x cb` to enable you to run the helper script (Sorry Windows users, but would love help with a PS script) +5. Run `./cb composer install` 6. [Configure Phinx](#phinx-configuration) -9. Run `vendor/bin/phinx migrate` to run the database migrations. -10. Copy `app/config/parameters.yml.dist` to `app/config/parameters.yml` and configure for your setup -11. [Configure Github](#github) -13. Visit in your browser! +7. Run `./cb cli vendor/bin/phinx migrate` to run the database migrations. +8. Copy `app/config/parameters.yml.dist` to `app/config/parameters.yml` and configure for your setup +9. [Configure Github](#github) +10. Visit in your browser! #### Running Without Vagrant @@ -65,13 +56,14 @@ Steps: We use [Phinx](https://phinx.org/) for managing our database migrations. It provides a programmatic way for handling table and data changes. It does require some initial setup however. -1. From the root project directory, run `vendor/bin/phinx init` to generate a `phinx.yml` file. +1. From the root project directory, run `./cb cli vendor/bin/phinx init` to generate a `phinx.yml` file. 2. Edit `./phinx.yml`'s development section (lines 19-21) with the following values for MySQL. ```{.yaml} - name: mentoring - user: mentoring - pass: vagrant + host: mysql + name: appdb + user: dbuser + pass: dbuser ``` To use sqlite, in `./phinx.yml` change change the adapter to `sqlite` (line 17) the name (line 19) to `data/mentoring.db`. @@ -107,21 +99,17 @@ github: #### Email in Development -Before you start the VM, you need to change your `parameters.yml` file. To use mailcatcher, you'll want the following config: +Before you start the Docker containers, you need to change your `parameters.yml` file. To use mailhog, you'll want the following config: ```{.yaml} mail: - host: '0.0.0.0' + host: 'mailhog' port: 1025 ``` -Mailcatcher is installed in the VM, but to use it you need to ssh into the VM and execute the following command to start the mail server: - -`mailcatcher --ip=0.0.0.0` - You can then view all emails being sent out by the app in your host machine's browser at the following address: -`http://192.168.56.101:1080` +`http://localhost:8025` #### Database Configuration diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index dba9281..0000000 --- a/Vagrantfile +++ /dev/null @@ -1,17 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - - config.vm.box = "scotch/box" - config.vm.network "private_network", ip: "192.168.56.101" - config.vm.hostname = "scotchbox" - config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=666"] } - - config.vm.provision "shell", path: "vagrant/shell/puppet.sh" - config.vm.provision :puppet do |puppet| - puppet.module_path = "vagrant/puppet/modules" - puppet.manifests_path = "vagrant/puppet/manifests" - puppet.manifest_file = "base.pp" - end -end \ No newline at end of file diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 3e56e9c..68b1f9c 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -1,12 +1,12 @@ database: driver: 'pdo_mysql' - host: 'localhost' - dbname: 'scotchbox' - user: 'root' - password: 'root' + host: 'mysql' + dbname: 'appdb' + user: 'dbuser' + password: 'dbuser' mail: - host: 'localhost' + host: 'mailhog' port: 25 username: '' password: '' diff --git a/cb b/cb new file mode 100755 index 0000000..0b66f27 --- /dev/null +++ b/cb @@ -0,0 +1,12 @@ +#!/bin/bash + +OPERATION=$1 +shift +ARGS=$* + +case ${OPERATION} in + + "cli") docker-compose run --rm -u $UID php-cli php ${ARGS};; + "composer") docker-compose run --rm -u $UID composer ${ARGS};; + *) echo "Unknown operation: ${OPERATION}";; +esac \ No newline at end of file diff --git a/composer.lock b/composer.lock index 67d03b7..027a854 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,6 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "ef16f15fb468a4ad7683a7b6a0f623f0", "content-hash": "120bd4a7c5cadb7fb41540fa1a35f135", "packages": [ { @@ -73,7 +72,7 @@ "docblock", "parser" ], - "time": "2016-10-24 11:45:47" + "time": "2016-10-24T11:45:47+00:00" }, { "name": "doctrine/cache", @@ -143,7 +142,7 @@ "cache", "caching" ], - "time": "2016-10-29 11:16:17" + "time": "2016-10-29T11:16:17+00:00" }, { "name": "doctrine/collections", @@ -209,7 +208,7 @@ "collections", "iterator" ], - "time": "2015-04-14 22:21:58" + "time": "2015-04-14T22:21:58+00:00" }, { "name": "doctrine/common", @@ -282,7 +281,7 @@ "persistence", "spl" ], - "time": "2015-12-25 13:18:31" + "time": "2015-12-25T13:18:31+00:00" }, { "name": "doctrine/dbal", @@ -353,7 +352,7 @@ "persistence", "queryobject" ], - "time": "2016-09-09 19:13:33" + "time": "2016-09-09T19:13:33+00:00" }, { "name": "doctrine/inflector", @@ -420,7 +419,7 @@ "singularize", "string" ], - "time": "2015-11-06 14:35:42" + "time": "2015-11-06T14:35:42+00:00" }, { "name": "doctrine/lexer", @@ -474,7 +473,7 @@ "lexer", "parser" ], - "time": "2014-09-09 13:34:57" + "time": "2014-09-09T13:34:57+00:00" }, { "name": "erusev/parsedown", @@ -513,7 +512,7 @@ "markdown", "parser" ], - "time": "2015-10-04 16:44:32" + "time": "2015-10-04T16:44:32+00:00" }, { "name": "ezyang/htmlpurifier", @@ -557,7 +556,7 @@ "keywords": [ "html" ], - "time": "2016-07-16 12:58:58" + "time": "2016-07-16T12:58:58+00:00" }, { "name": "guzzlehttp/guzzle", @@ -619,7 +618,7 @@ "rest", "web service" ], - "time": "2016-10-08 15:01:37" + "time": "2016-10-08T15:01:37+00:00" }, { "name": "guzzlehttp/promises", @@ -670,7 +669,7 @@ "keywords": [ "promise" ], - "time": "2016-05-18 16:56:05" + "time": "2016-05-18T16:56:05+00:00" }, { "name": "guzzlehttp/psr7", @@ -728,7 +727,7 @@ "stream", "uri" ], - "time": "2016-06-24 23:00:38" + "time": "2016-06-24T23:00:38+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -773,7 +772,7 @@ "keywords": [ "test" ], - "time": "2015-05-11 14:41:42" + "time": "2015-05-11T14:41:42+00:00" }, { "name": "ircmaxell/random-lib", @@ -828,7 +827,7 @@ "random-numbers", "random-strings" ], - "time": "2016-09-07 15:52:06" + "time": "2016-09-07T15:52:06+00:00" }, { "name": "ircmaxell/security-lib", @@ -874,7 +873,7 @@ ], "description": "A Base Security Library", "homepage": "https://github.com/ircmaxell/SecurityLib", - "time": "2015-03-20 14:31:23" + "time": "2015-03-20T14:31:23+00:00" }, { "name": "league/oauth2-client", @@ -937,7 +936,7 @@ "oauth2", "single sign on" ], - "time": "2016-07-28 13:20:43" + "time": "2016-07-28T13:20:43+00:00" }, { "name": "league/oauth2-github", @@ -993,19 +992,19 @@ "oauth", "oauth2" ], - "time": "2016-04-14 01:57:14" + "time": "2016-04-14T01:57:14+00:00" }, { "name": "mockery/mockery", "version": "0.9.5", "source": { "type": "git", - "url": "https://github.com/padraic/mockery.git", + "url": "https://github.com/mockery/mockery.git", "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/4db079511a283e5aba1b3c2fb19037c645e70fc2", + "url": "https://api.github.com/repos/mockery/mockery/zipball/4db079511a283e5aba1b3c2fb19037c645e70fc2", "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2", "shasum": "" }, @@ -1058,7 +1057,7 @@ "test double", "testing" ], - "time": "2016-05-22 21:52:33" + "time": "2016-05-22T21:52:33+00:00" }, { "name": "monolog/monolog", @@ -1136,7 +1135,7 @@ "logging", "psr-3" ], - "time": "2016-07-29 03:23:52" + "time": "2016-07-29T03:23:52+00:00" }, { "name": "paragonie/random_compat", @@ -1184,7 +1183,7 @@ "pseudorandom", "random" ], - "time": "2016-10-17 15:23:22" + "time": "2016-10-17T15:23:22+00:00" }, { "name": "pimple/pimple", @@ -1230,7 +1229,7 @@ "container", "dependency injection" ], - "time": "2015-09-11 15:10:35" + "time": "2015-09-11T15:10:35+00:00" }, { "name": "psr/http-message", @@ -1280,7 +1279,7 @@ "request", "response" ], - "time": "2016-08-06 14:39:51" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "psr/log", @@ -1327,20 +1326,20 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "robmorgan/phinx", - "version": "v0.6.5", + "version": "v0.6.6", "source": { "type": "git", - "url": "https://github.com/robmorgan/phinx.git", - "reference": "6943cb4bb78bf9d3964967a032220b7c793b97b7" + "url": "https://github.com/cakephp/phinx.git", + "reference": "cc97b79f62c2180caba0be1d3744a335a296a678" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/robmorgan/phinx/zipball/6943cb4bb78bf9d3964967a032220b7c793b97b7", - "reference": "6943cb4bb78bf9d3964967a032220b7c793b97b7", + "url": "https://api.github.com/repos/cakephp/phinx/zipball/cc97b79f62c2180caba0be1d3744a335a296a678", + "reference": "cc97b79f62c2180caba0be1d3744a335a296a678", "shasum": "" }, "require": { @@ -1393,7 +1392,7 @@ "migrations", "phinx" ], - "time": "2016-10-27 10:16:12" + "time": "2017-01-23T08:53:20+00:00" }, { "name": "rpodwika/yaml-config-service-provider", @@ -1432,7 +1431,7 @@ } ], "description": "Based on deralex/YamlConfigServiceProvider YAML service provider for silex ~2.0 and symfony/yaml 3.~", - "time": "2016-09-15 13:14:21" + "time": "2016-09-15T13:14:21+00:00" }, { "name": "silex/silex", @@ -1517,7 +1516,7 @@ "keywords": [ "microframework" ], - "time": "2016-08-22 17:50:21" + "time": "2016-08-22T17:50:21+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -1570,7 +1569,7 @@ "mail", "mailer" ], - "time": "2016-07-08 11:51:25" + "time": "2016-07-08T11:51:25+00:00" }, { "name": "symfony/config", @@ -1623,7 +1622,7 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2016-09-25 08:27:07" + "time": "2016-09-25T08:27:07+00:00" }, { "name": "symfony/console", @@ -1684,7 +1683,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-10-06 01:44:51" + "time": "2016-10-06T01:44:51+00:00" }, { "name": "symfony/debug", @@ -1741,7 +1740,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-09-06 11:02:40" + "time": "2016-09-06T11:02:40+00:00" }, { "name": "symfony/event-dispatcher", @@ -1801,7 +1800,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-10-13 06:28:43" + "time": "2016-10-13T06:28:43+00:00" }, { "name": "symfony/filesystem", @@ -1850,7 +1849,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2016-10-18 04:30:12" + "time": "2016-10-18T04:30:12+00:00" }, { "name": "symfony/form", @@ -1924,7 +1923,7 @@ ], "description": "Symfony Form Component", "homepage": "https://symfony.com", - "time": "2016-10-18 04:30:12" + "time": "2016-10-18T04:30:12+00:00" }, { "name": "symfony/http-foundation", @@ -1977,7 +1976,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2016-10-24 15:52:44" + "time": "2016-10-24T15:52:44+00:00" }, { "name": "symfony/http-kernel", @@ -2059,7 +2058,7 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2016-10-27 02:38:31" + "time": "2016-10-27T02:38:31+00:00" }, { "name": "symfony/inflector", @@ -2116,7 +2115,7 @@ "symfony", "words" ], - "time": "2016-06-08 11:24:07" + "time": "2016-06-08T11:24:07+00:00" }, { "name": "symfony/intl", @@ -2191,7 +2190,7 @@ "l10n", "localization" ], - "time": "2016-09-06 11:02:40" + "time": "2016-09-06T11:02:40+00:00" }, { "name": "symfony/options-resolver", @@ -2245,7 +2244,7 @@ "configuration", "options" ], - "time": "2016-05-12 15:59:27" + "time": "2016-05-12T15:59:27+00:00" }, { "name": "symfony/polyfill-intl-icu", @@ -2303,7 +2302,7 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-05-18T14:26:46+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -2362,7 +2361,7 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-05-18T14:26:46+00:00" }, { "name": "symfony/polyfill-php56", @@ -2418,7 +2417,7 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-05-18T14:26:46+00:00" }, { "name": "symfony/polyfill-php70", @@ -2477,7 +2476,7 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-05-18T14:26:46+00:00" }, { "name": "symfony/polyfill-util", @@ -2529,7 +2528,7 @@ "polyfill", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-05-18T14:26:46+00:00" }, { "name": "symfony/property-access", @@ -2591,7 +2590,7 @@ "property path", "reflection" ], - "time": "2016-08-15 13:15:28" + "time": "2016-08-15T13:15:28+00:00" }, { "name": "symfony/routing", @@ -2666,7 +2665,7 @@ "uri", "url" ], - "time": "2016-08-16 14:58:24" + "time": "2016-08-16T14:58:24+00:00" }, { "name": "symfony/security-core", @@ -2732,7 +2731,7 @@ ], "description": "Symfony Security Component - Core Library", "homepage": "https://symfony.com", - "time": "2016-10-06 01:44:51" + "time": "2016-10-06T01:44:51+00:00" }, { "name": "symfony/security-csrf", @@ -2790,7 +2789,7 @@ ], "description": "Symfony Security Component - CSRF Library", "homepage": "https://symfony.com", - "time": "2016-07-05 11:09:33" + "time": "2016-07-05T11:09:33+00:00" }, { "name": "symfony/translation", @@ -2854,7 +2853,7 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2016-10-18 04:30:12" + "time": "2016-10-18T04:30:12+00:00" }, { "name": "symfony/twig-bridge", @@ -2935,7 +2934,7 @@ ], "description": "Symfony Twig Bridge", "homepage": "https://symfony.com", - "time": "2016-10-24 15:52:44" + "time": "2016-10-24T15:52:44+00:00" }, { "name": "symfony/validator", @@ -3009,7 +3008,7 @@ ], "description": "Symfony Validator Component", "homepage": "https://symfony.com", - "time": "2016-10-19 22:38:53" + "time": "2016-10-19T22:38:53+00:00" }, { "name": "symfony/yaml", @@ -3058,7 +3057,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-10-24 18:41:13" + "time": "2016-10-24T18:41:13+00:00" }, { "name": "twig/twig", @@ -3119,7 +3118,7 @@ "keywords": [ "templating" ], - "time": "2016-10-25 19:17:17" + "time": "2016-10-25T19:17:17+00:00" }, { "name": "vlucas/phpdotenv", @@ -3169,7 +3168,7 @@ "env", "environment" ], - "time": "2016-09-01 10:05:43" + "time": "2016-09-01T10:05:43+00:00" } ], "packages-dev": [ @@ -3225,7 +3224,7 @@ "constructor", "instantiate" ], - "time": "2014-10-13 12:58:55" + "time": "2014-10-13T12:58:55+00:00" }, { "name": "pdepend/pdepend", @@ -3264,7 +3263,7 @@ "BSD-3-Clause" ], "description": "Official version of pdepend to be handled with Composer", - "time": "2015-03-02 08:06:43" + "time": "2015-03-02T08:06:43+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -3313,7 +3312,7 @@ "email": "mike.vanriel@naenius.com" } ], - "time": "2015-02-03 12:10:50" + "time": "2015-02-03T12:10:50+00:00" }, { "name": "phpmd/phpmd", @@ -3375,7 +3374,7 @@ "phpmd", "pmd" ], - "time": "2015-03-26 07:47:05" + "time": "2015-03-26T07:47:05+00:00" }, { "name": "phpspec/prophecy", @@ -3435,7 +3434,7 @@ "spy", "stub" ], - "time": "2015-04-27 22:15:08" + "time": "2015-04-27T22:15:08+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3497,7 +3496,7 @@ "testing", "xunit" ], - "time": "2015-04-11 04:35:00" + "time": "2015-04-11T04:35:00+00:00" }, { "name": "phpunit/php-file-iterator", @@ -3544,7 +3543,7 @@ "filesystem", "iterator" ], - "time": "2015-04-02 05:19:05" + "time": "2015-04-02T05:19:05+00:00" }, { "name": "phpunit/php-text-template", @@ -3588,7 +3587,7 @@ "keywords": [ "template" ], - "time": "2014-01-30 17:20:04" + "time": "2014-01-30T17:20:04+00:00" }, { "name": "phpunit/php-timer", @@ -3632,7 +3631,7 @@ "keywords": [ "timer" ], - "time": "2013-08-02 07:42:54" + "time": "2013-08-02T07:42:54+00:00" }, { "name": "phpunit/php-token-stream", @@ -3681,7 +3680,7 @@ "keywords": [ "tokenizer" ], - "time": "2015-04-08 04:46:07" + "time": "2015-04-08T04:46:07+00:00" }, { "name": "phpunit/phpunit", @@ -3753,7 +3752,7 @@ "testing", "xunit" ], - "time": "2015-04-11 05:23:21" + "time": "2015-04-11T05:23:21+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -3808,7 +3807,7 @@ "mock", "xunit" ], - "time": "2015-04-02 05:36:41" + "time": "2015-04-02T05:36:41+00:00" }, { "name": "sebastian/comparator", @@ -3872,7 +3871,7 @@ "compare", "equality" ], - "time": "2015-01-29 16:28:08" + "time": "2015-01-29T16:28:08+00:00" }, { "name": "sebastian/diff", @@ -3924,7 +3923,7 @@ "keywords": [ "diff" ], - "time": "2015-02-22 15:13:53" + "time": "2015-02-22T15:13:53+00:00" }, { "name": "sebastian/environment", @@ -3974,7 +3973,7 @@ "environment", "hhvm" ], - "time": "2015-01-01 10:01:08" + "time": "2015-01-01T10:01:08+00:00" }, { "name": "sebastian/exporter", @@ -4040,7 +4039,7 @@ "export", "exporter" ], - "time": "2015-01-27 07:23:06" + "time": "2015-01-27T07:23:06+00:00" }, { "name": "sebastian/global-state", @@ -4091,7 +4090,7 @@ "keywords": [ "global state" ], - "time": "2014-10-06 09:23:50" + "time": "2014-10-06T09:23:50+00:00" }, { "name": "sebastian/recursion-context", @@ -4144,7 +4143,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-01-24 09:48:32" + "time": "2015-01-24T09:48:32+00:00" }, { "name": "sebastian/version", @@ -4179,7 +4178,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-02-24 06:35:25" + "time": "2015-02-24T06:35:25+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -4253,7 +4252,7 @@ "phpcs", "standards" ], - "time": "2015-04-23 03:40:59" + "time": "2015-04-23T03:40:59+00:00" }, { "name": "symfony/dependency-injection", @@ -4314,7 +4313,7 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "http://symfony.com", - "time": "2015-03-30 15:54:10" + "time": "2015-03-30T15:54:10+00:00" } ], "aliases": [], diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..154b64d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: '3' +volumes: + mysql_data: { driver: local } +services: + httpd: + build: ./docker/httpd + ports: ['8080:80'] + volumes: + - './app:/var/www/app' + - './data/migrations:/var/www/data/migrations' + - './public:/var/www/public' + - './src:/var/www/src' + - './vendor:/var/www/vendor' + - './views:/var/www/views' + mysql: { volumes: ['mysql_data:/var/lib/mysql'], environment: { MYSQL_ROOT_PASSWORD: rootpassword, MYSQL_USER: dbuser, MYSQL_PASSWORD: dbuser, MYSQL_DATABASE: appdb }, image: 'mysql:5.6' } + php-cli: { build: ./docker/php/, working_dir: /var/www/, volumes: ['./:/var/www/'] } + composer: { image: composer, volumes: ['./:/var/www/', '~/.ssh/:/root/.ssh'], tty: true, working_dir: /var/www/, command: 'composer install' } + mailhog: { image: mailhog/mailhog, ports: ['8025:8025'] } diff --git a/docker/httpd/Dockerfile b/docker/httpd/Dockerfile new file mode 100644 index 0000000..1247d53 --- /dev/null +++ b/docker/httpd/Dockerfile @@ -0,0 +1,11 @@ +FROM php:7.1-apache + +RUN a2enmod rewrite && \ + sed -i "s/DocumentRoot \/var\/www\/html/DocumentRoot \/var\/www\/public/" /etc/apache2/sites-enabled/000-default.conf && \ + mkdir -p /var/www/data/logs && \ + chown www-data:www-data /var/www/data/logs && \ + apt-get update && \ + apt-get install -y libzip-dev libicu-dev libxml2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev && \ + docker-php-ext-install mbstring zip gd intl xml curl json pdo pdo_mysql && pecl install -o -f xdebug && docker-php-ext-enable xdebug + +WORKDIR /var/www/public \ No newline at end of file diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile new file mode 100644 index 0000000..0d0758a --- /dev/null +++ b/docker/php/Dockerfile @@ -0,0 +1,7 @@ +FROM php:7.1-cli + +RUN apt-get update && \ + apt-get install -y libzip-dev libicu-dev libxml2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev && \ + docker-php-ext-install mbstring zip gd intl xml curl json pdo pdo_mysql && pecl install -o -f xdebug && docker-php-ext-enable xdebug + +WORKDIR /var/www/public \ No newline at end of file diff --git a/vagrant/puppet/manifests/base.pp b/vagrant/puppet/manifests/base.pp deleted file mode 100644 index d447666..0000000 --- a/vagrant/puppet/manifests/base.pp +++ /dev/null @@ -1,19 +0,0 @@ -Exec { path => ["/bin/", "/sbin/", "/usr/bin/", "/usr/sbin/" ] } - -exec { "apt-get update": } - -$system_packages = ['curl', 'git', 'vim', 'unzip', 'screen', 'telnet'] - -package {$system_packages: - ensure => present, - require => Exec['apt-get update'] -} - -class { "apache2": - doc_root => "/var/www/public", - domain => "mentoring.dev" -} - -class {"php": - php_packages => ['php5-cli', 'php5-intl', 'php5-mcrypt', 'php5-gd', 'php5-xdebug'] -} \ No newline at end of file diff --git a/vagrant/puppet/modules/apache2/files/local.dev.crt b/vagrant/puppet/modules/apache2/files/local.dev.crt deleted file mode 100644 index a4e67ff..0000000 --- a/vagrant/puppet/modules/apache2/files/local.dev.crt +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIC+zCCAeOgAwIBAgIJAORHPZWy5xFaMA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNV -BAMMCWxvY2FsLmRldjAeFw0xNjAzMjEwNDU4MThaFw0yNjAzMTkwNDU4MThaMBQx -EjAQBgNVBAMMCWxvY2FsLmRldjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAMX4vaIvjFeDWi2O9baWbW4QRbjty5VhWcFEYeN0h+CEMxeQg1QKaZSLPLLU -M0NT/EdBzMl88fBafcJ2/chCmfi/Phxja9aBXAOuwFCQYCqVyQRO0bMLm7s28D6g -b4qHirh6dkafizjHQb5lScT/RqoZDnLBhFAuJ766EwcutASghOeGPQP0Uv8Y9MmV -9BYaYSpRDx6CJA2DNa2CX7jZ+EWYFNJo8yUMSstUDrfm2nA9gH1GsJ2/09SJOm6y -QL0YTeh+iY9es4dNYOVOfqE5ua34vKKvm4GrAhdJoxXMhNJqMM8L6njXiMzps76s -2EiMHh/xehp/viQ2s4o+OdCMT8sCAwEAAaNQME4wHQYDVR0OBBYEFBxdvngE5gke -wMMUcA9crVOJV99TMB8GA1UdIwQYMBaAFBxdvngE5gkewMMUcA9crVOJV99TMAwG -A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAJR+aaGQ4Z0hfEqRvr1GLkgv -uK50hOHV6cHD9Exa0R0eT+6x6bCdvYEaclMf+v7ELVn4P2GjUxjZS/239kNmvCsT -475S1wEvDrYwiYdvWI9sCouTbZLu5oq5Oib6WcNJUDWkXKG3swfOF1M0vW7hV+yB -mO36ha07Itg0CNO0XuuuVyVtglnlI990vYU0JJ9sz+kP2YnXqMEdlhl2i9UI5hg1 -Cn4kEzNhqwLHmm1CdqWx2gWjPQJq3AfKKRwplimwQcgFzwuXWp76j2Jo9aF6KBad -Q8+9s6EK+VtEGlw6TDV+OsgNanomZrbZxM4WbXPOtabj6aV+nXgo+cWIR9tMNEs= ------END CERTIFICATE----- diff --git a/vagrant/puppet/modules/apache2/manifests/init.pp b/vagrant/puppet/modules/apache2/manifests/init.pp deleted file mode 100644 index 734f4c3..0000000 --- a/vagrant/puppet/modules/apache2/manifests/init.pp +++ /dev/null @@ -1,39 +0,0 @@ -class apache2 ( - $doc_root = '/vagrant', - $domain = 'local.dev' -) { - package {'apache2': - ensure => 'present' - } - - service {'apache2': - ensure => 'running', - require => Package['apache2'], - } - - exec {'a2enmod ssl': - creates => '/etc/apache2/mods-enabled/ssl.conf' - } - - file {'/etc/ssl/private/local.dev.crt': - source => "puppet:///modules/apache2/local.dev.crt" - } - - file {'/etc/apache2/sites-enabled/vhost.conf': - owner => root, - group => root, - mode => 664, - content => template('apache2/vhost.conf.erb'), - notify => Service['apache2'], - require => Package['apache2'], - } - - file {'/etc/apache2/conf-enabled/enablesendfile.conf': - owner => root, - group => root, - mode => 664, - content => template('apache2/enablesendfile.conf.erb'), - notify => Service['apache2'], - require => Package['apache2'], - } -} \ No newline at end of file diff --git a/vagrant/puppet/modules/apache2/templates/enablesendfile.conf.erb b/vagrant/puppet/modules/apache2/templates/enablesendfile.conf.erb deleted file mode 100644 index ad28f0a..0000000 --- a/vagrant/puppet/modules/apache2/templates/enablesendfile.conf.erb +++ /dev/null @@ -1 +0,0 @@ -EnableSendFile off \ No newline at end of file diff --git a/vagrant/puppet/modules/apache2/templates/vhost.conf.erb b/vagrant/puppet/modules/apache2/templates/vhost.conf.erb deleted file mode 100644 index 5332e16..0000000 --- a/vagrant/puppet/modules/apache2/templates/vhost.conf.erb +++ /dev/null @@ -1,29 +0,0 @@ - - ServerName <%= @domain %> - - DirectoryIndex index.php - DocumentRoot <%= @doc_root %> - ErrorLog /var/log/apache2/<%= @domain %>.error.log - CustomLog /var/log/apache2/<%= @domain %>.access.log combined - - > - FallbackResource /index.php - - - - - ServerName <%= @domain %> - - DirectoryIndex index.php - DocumentRoot <%= @doc_root %> - ErrorLog /var/log/apache2/<%= @domain %>-ssl.error.log - CustomLog /var/log/apache2/<%= @domain %>-ssl.access.log combined - - SSLEngine on - SSLCertificateFile /etc/ssl/private/local.dev.crt - SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key - - > - FallbackResource /index.php - - \ No newline at end of file diff --git a/vagrant/puppet/modules/php/files/custom.ini b/vagrant/puppet/modules/php/files/custom.ini deleted file mode 100644 index cc6d505..0000000 --- a/vagrant/puppet/modules/php/files/custom.ini +++ /dev/null @@ -1 +0,0 @@ -always_populate_raw_post_data = -1 \ No newline at end of file diff --git a/vagrant/puppet/modules/php/files/xdebug.ini b/vagrant/puppet/modules/php/files/xdebug.ini deleted file mode 100644 index 76ceb03..0000000 --- a/vagrant/puppet/modules/php/files/xdebug.ini +++ /dev/null @@ -1,6 +0,0 @@ -xdebug.default_enable = 1 -xdebug.remote_autostart = 0 -xdebug.remote_connect_back = 1 -xdebug.remote_enable = 1 -xdebug.remote_handler = dbgp -xdebug.remote_port = 9000 \ No newline at end of file diff --git a/vagrant/puppet/modules/php/manifests/init.pp b/vagrant/puppet/modules/php/manifests/init.pp deleted file mode 100644 index 8c724a6..0000000 --- a/vagrant/puppet/modules/php/manifests/init.pp +++ /dev/null @@ -1,29 +0,0 @@ -class php( - $php_packages = ['php5', 'php5-mysql', 'php5-gd', 'php5-xdebug', 'php5-mcrypt', 'php5-cli', 'php5-dev','php5-curl', 'php-pear'] -) { - package { $php_packages: - ensure => 'present', - notify => Service['apache2'], - require => Exec['apt-get update'] - } - - file {'/etc/php5/mods-available/xdebug.ini': - source => "puppet:///modules/php/xdebug.ini" - } - - file {'/etc/php5/apache2/conf.d/xdebug.ini': - source => "puppet:///modules/php/xdebug.ini", - notify => Service['apache2'], - require => Package['apache2'], - } - - file {'/etc/php5/apache2/conf.d/custom.ini': - source => "puppet:///modules/php/custom.ini", - notify => Service['apache2'], - require => Package['apache2'], - } - - file {'/etc/php5/cli/conf.d/xdebug.ini': - source => "puppet:///modules/php/xdebug.ini" - } -} \ No newline at end of file diff --git a/vagrant/shell/puppet.sh b/vagrant/shell/puppet.sh deleted file mode 100644 index 08b405e..0000000 --- a/vagrant/shell/puppet.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -if ! type "puppet" > /dev/null; then - apt-get update && apt-get -y install puppet -fi \ No newline at end of file