Permalink
Browse files

Update

  • Loading branch information...
viljaste committed Sep 5, 2017
1 parent efd9404 commit ca9c5e0c025e7b401217a780f70424e1fc6e744d
Showing with 189 additions and 64 deletions.
  1. +21 −0 LICENSE.md
  2. +166 −62 README.md
  3. +1 −1 bin/restart-services.sh
  4. +1 −1 bin/show-url.sh
View
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Jürgen Viljaste
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
View
228 README.md
@@ -1,7 +1,9 @@
# Drupalstack
Docker based development environment for Drupal 8 using only official Docker images.
## Featuring
* Apache 2.4
* PHP 7.1
* MySQL 5.7
@@ -14,76 +16,178 @@ Docker based development environment for Drupal 8 using only official Docker ima
* Blackfire integration
* HTTP2 support
## Quickstart guide
# Quickstart guide
To quickly get start working on your next Drupal 8 project simply follow this
quickstart guide.
* Clone this project
NB! This quickstart guide assumes that you already have your host machine set
up accordingly to work with Docker and other tools.
git clone git@github.com:viljaste/drupalstack.git my-project
1. Clone this project
* Go to project directory
```bash
$ git clone https://github.com/picco/drupalstack.git my-project
```
cd my-project
* Start project services
2. Go to project directory
./bin/start-services.sh
* Install project
```bash
$ cd my-project
```
3. Start project services
./bin/install-project.sh
```bash
$ ./bin/start-services.sh
```
4. Install Drupal 8
```bash
$ ./bin/install-project.sh
```
5. Access project via web browser
* Get project
```bash
$ ./bin/show-url.sh
```
## Helper scripts
Directory `bin` contains many helper scripts for frequent operations that you
definitely want to use to control your project in various ways. It is
encourage to contribute more such scripts to improve the overall workflow when
working with a project.
* Build project services
Increased the PHP memory limit? Enabled some random module for Apache?
Rebuild your services Docker images easily with this helper script.
```bash
$ ./bin/build-services.sh
```
* Export project database dump
Quickly create a database dump and export it to your project root directory.
```bash
$ ./bin/export-database-dump.sh
```
* Install system-wide Portainer service
```bash
$ ./bin/install-portainer.sh
```
* Install Drupal 8
Kickstart your Drupal 8 project with the help of this script. Read more about
it from here https://github.com/drupal-composer/drupal-project if you want to
know what exactly happens after you have executed this script.
```bash
$ ./bin/install-project.sh
```
* Remove project files
./bin/show-ports.sh
Need to remove your project files and start over from scratch? Use this
script to delete all your files. Be cautious, because there is no way to
restore them if you haven't added your project files to Git for example.
```bash
$ ./bin/remove-files.sh
```
* Remove system-wide Portainer service
```bash
$ ./bin/remove-portainer.sh
```
* Restart project services
Enables you to quickly restart all of your project services.
```bash
$ ./bin/restart-services.sh
```
* Enter httpd service
```bash
$ ./bin/shell-into-httpd.sh
```
* Enter MySQL service
Drush or PhpMyAdmin aren't providing everything you need to interact with your
project databases? Enter you MySQL service by using this script and start
hacking SQL directly from the CLI.
```bash
$ ./bin/shell-into-mysql.sh
```
* Enter PHP service
Need to use PHP from the command line or execute Drush or Drupal Compose
against your Drupal project? Use this script to quickly enter your PHP service.
```bash
$ ./bin/shell-into-php.sh
```
* Show project services logs
You have a problem with your project or some service just stopped running?
Use this script to see all your project services logs for easy debugging.
```bash
$ ./bin/show-logs.sh
```
* Show project services ports
Lists your project services exposed ports to access them easily if you have
multiple projects running on your machine at the same time.
```bash
$ ./bin/show-ports.sh
```
* Show project URL-s
Don't like to search for Apache ports from Docker Compose process list each
time you use it? Use this script to get only the relevant URL-s that you can
paste directly to your web browser address bar to have a quick access to your
project.
```bash
$ ./bin/show-url.sh
```
* Build and run project services
Need to start your project services but don't exactly remember how to do it
with Docker Compose? Simply run this script from your project directory and it
will start your project services for you.
```bash
$ ./bin/start-services.sh
```
## Configuring the host machine
The only dependencies for your host machine are Docker and Docker Compose. Follow the set-up instructions on https://docs.docker.com/engine/installation/linux/ubuntu/ and https://docs.docker.com/compose/install/ to configure your host.
## Setting up your environment
## Accessing your services
You can access the services running in the containers from the following (default) URL-s.
### Your Drupal site
```http://web.local:8080```
### PHPMyAdmin
```http://pma.local:8080```
### MailHog
```http://mailhog.local:8080```
## Installing Drupal
You should use Composer to install Drupal and all it's dependencies. Default dependencies, including Drupal core, are defined in ```web/composer.json``` which you can manage using ```$ docker-compose run composer <command>```.
```bash
$ docker-compose run composer install
```
## Interacting with your Docker environment
You need to run the following commands in your project root folder (where your docker-compose.yml is located).
### Start the environment
```bash
$ docker-compose up -d
```
You can also start the environment without the ```-d``` if you'd like to get all log messages to your STDOUT.
### Stop the environment
```bash
$ docker-compose down
```
### Check the status of the environment
```bash
$ docker-compose ps
```
Note: It's expected, that the composer, drupal and drush containers are in exited state.
### Use Composer
```bash
$ docker-compose run composer <command>
```
### Use Drush
```bash
$ docker-compose run drush <command>
```
### Use Drupal Console
```bash
$ docker-compose run drupal <command>
```
### Get console access to your Apache/PHP conatiner
```bash
$ docker exec -it <projectname>_web_1 bash
```
You have multiple containers running in your environment. Use ```drupal-compose ps``` to list all the containers you can connect to.
The only dependencies for your host machine are Docker and Docker Compose.
Follow the set-up instructions on https://docs.docker.com/engine/installation/linux/ubuntu/
and https://docs.docker.com/compose/install/ to configure your host.
## License
**MIT**
View
@@ -4,7 +4,7 @@ set -e
# ---------------------------------------------------------------------------- #
# #
# Build and run project services. #
# Restart project services. #
# #
# ---------------------------------------------------------------------------- #
View
@@ -4,7 +4,7 @@ set -e
# ---------------------------------------------------------------------------- #
# #
# Show project services ports. #
# Show project URL-s. #
# #
# ---------------------------------------------------------------------------- #

0 comments on commit ca9c5e0

Please sign in to comment.