Permalink
Browse files

Update

  • Loading branch information...
viljaste committed Aug 28, 2017
1 parent 434c301 commit 3716bf3e9ceb4d93a44627b759ad8d76152f3345
View
21 .env
@@ -1,16 +1,7 @@
APP_NAME=Drupalstack
MYSQL_DATABASE=drupal
MYSQL_USER=container
MYSQL_PASSWORD=container
MYSQL_ROOT_PASSWORD=root
WEB=web.local
PMA=pma.local
MAILHOG=mailhog.local
PORT=8000
XDEBUG_PORT=9000
DB_NAME=app
DB_USER=app
DB_PASS=app
DB_ROOT_PASS=app
NEWRELIC_KEY=
BLACKFIRE_SERVER_ID=
BLACKFIRE_SERVER_TOKEN=
View
@@ -0,0 +1,7 @@
MYSQL_DATABASE=drupal
MYSQL_USER=container
MYSQL_PASSWORD=container
MYSQL_ROOT_PASSWORD=root
BLACKFIRE_SERVER_ID=
BLACKFIRE_SERVER_TOKEN=
View
@@ -0,0 +1 @@
.idea
View
@@ -4,8 +4,8 @@ Docker based development environment for Drupal 8.
## Featuring
* Apache 2.4
* PHP 7.1
* MariaDB 5.5
* Composer based Drupal installation
* MySQL 5.7
* Composer
* Drush
* Drupal Console
* PHPMyAdmin
@@ -0,0 +1,83 @@
#!/usr/bin/env bash
set -xe
# ---------------------------------------------------------------------------- #
# #
# Readme: https://github.com/drupal-composer/drupal-project #
# #
# ---------------------------------------------------------------------------- #
WORKING_DIR="$(pwd)"
SCRIPT_PATH="$(dirname ${0})"
SCRIPT_PATH="$(cd ${SCRIPT_PATH} && pwd)"
PROJECT_ROOT="$(cd ${SCRIPT_PATH}/.. && pwd)"
hash docker 2> /dev/null
if [ "${?}" -ne 0 ]; then
echo "docker command not found."
exit 1
fi
hash docker-compose 2> /dev/null
if [ "${?}" -ne 0 ]; then
echo "docker-compose command not found."
exit 1
fi
php_container_exists() {
local PROJECT_ROOT="${1}"
echo "$(cd ${PROJECT_ROOT} && docker-compose -f docker-compose.yml ps php 2> /dev/null | grep _php_ | awk '{ print $1 }')"
}
php_container_running() {
local CONTAINER="${1}"
echo "$(docker exec ${CONTAINER} date 2> /dev/null)"
}
PHP_CONTAINER="$(php_container_exists ${PROJECT_ROOT})"
if [ -z "${PHP_CONTAINER}" ]; then
read -p "PHP container could not be found. Would you like to start the containers? [Y/n]: " ANSWER
if [ "${ANSWER}" == "n" ]; then
exit
fi
cd "${PROJECT_ROOT}"
docker-compose -f docker-compose.yml up -d
PHP_CONTAINER="$(php_container_exists ${PROJECT_ROOT})"
echo "crush: Waiting for PHP service to come up..."
sleep 30
elif [ -z "$(php_container_running ${PHP_CONTAINER})" ]; then
read -p "crush: PHP container is not running. Would you like to start the containers? [Y/n]: " ANSWER
if [ "${ANSWER}" == "n" ]; then
exit
fi
cd "${PROJECT_ROOT}"
docker-compose -f docker-compose.yml up -d
echo "crush: Waiting for PHP service to come up..."
sleep 30
fi
docker exec -it "${PHP_CONTAINER}" bash -c "wget https://raw.githubusercontent.com/drupal-composer/drupal-project/8.x/composer.json -O /usr/local/apache2/htdocs/composer.json"
docker exec -it "${PHP_CONTAINER}" bash -c "cd /usr/local/apache2/htdocs && composer install"
cd "${WORKING_DIR}"
View
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -xe
# ---------------------------------------------------------------------------- #
# #
# Readme: https://github.com/portainer/portainer #
# #
# ---------------------------------------------------------------------------- #
hash docker 2> /dev/null
if [ "${?}" -ne 0 ]; then
echo "docker command not found."
exit 1
fi
endpoints() {
cat <<"EOF"
[
{
"Name": "local",
"URL": "unix:///var/run/docker.sock"
}
]
EOF
}
mkdir -p /tmp/endpoints
echo -n "$(endpoints)" > /tmp/endpoints/endpoints.json
docker rm -fv portainer
docker run -d -p 80:9000 --restart="always" --name portainer -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/endpoints:/endpoints portainer/portainer:latest --no-auth --external-endpoints /endpoints/endpoints.json
View

This file was deleted.

Oops, something went wrong.
View

This file was deleted.

Oops, something went wrong.
View
@@ -1,77 +1,51 @@
version: '3'
volumes:
db-data:
mysql-data:
services:
nginx-proxy:
image: jwilder/nginx-proxy
httpd:
build: ./services/httpd
ports:
- "${PORT}:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
environment:
- DEFAULT_HOST=${WEB}
web:
build: "web"
expose:
- "80"
ports:
- "${XDEBUG_PORT}:9000"
- "443"
volumes:
- ./web:/web
- ./www:/usr/local/apache2/htdocs
links:
- db:mysql
- mailhog:mailhog
environment:
- VIRTUAL_HOST=${WEB}
- XDEBUG_CONFIG=remote_host=172.18.0.4
- NR_INSTALL_KEY=${NEWRELIC_KEY}
- NR_INSTALL_SILENT=1
- NR_APP_NAME=${APP_NAME}
working_dir: /web
db:
build: "db"
volumes:
- db-data:/var/lib/mysql
environment:
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASS}
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASS}
composer:
image: composer/composer
volumes:
- ./web:/web
working_dir: /web
drush:
image: drush/drush:8
- php:php
php:
build: ./services/php
volumes:
- ./web:/web
- ./www:/usr/local/apache2/htdocs
links:
- db:mysql
working_dir: /web/docroot
drupal:
build: drupal-console
- mysql:db
- mailhog:mailhog
- blackfire:blackfire
mysql:
build: ./services/mysql
volumes:
- ./web:/web
links:
- db:mysql
working_dir: /web/docroot
pma:
image: "phpmyadmin/phpmyadmin"
expose:
- mysql-data:/var/lib/mysql
ports:
- "3306"
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
blackfire:
image: blackfire/blackfire:latest
environment:
- BLACKFIRE_SERVER_ID=${BLACKFIRE_SERVER_ID}
- BLACKFIRE_SERVER_TOKEN=${BLACKFIRE_SERVER_TOKEN}
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
ports:
- "80"
links:
- db:mysql
- mysql:db
environment:
- PMA_HOST=mysql
- PMA_USER=app
- PMA_PASSWORD=app
- VIRTUAL_HOST=${PMA}
- PMA_USER=root
- PMA_PASSWORD=${MYSQL_ROOT_PASSWORD}
mailhog:
image: "mailhog/mailhog"
expose:
image: mailhog/mailhog:latest
ports:
- "1025"
- "8025"
environment:
- VIRTUAL_HOST=${MAILHOG}
- VIRTUAL_PORT=8025

This file was deleted.

Oops, something went wrong.
View

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,8 @@
FROM httpd:2.4
RUN echo "Europe/Tallinn" > /etc/timezone \
&& dpkg-reconfigure -f noninteractive tzdata
COPY ./src/usr/local/apache2/conf/extra/httpd-php.conf /usr/local/apache2/conf/extra/httpd-php.conf
COPY ./src/usr/local/apache2/conf/httpd.conf /usr/local/apache2/conf/httpd.conf
@@ -0,0 +1,3 @@
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
ProxyPassMatch "^/(.*\.php(/.*)?)$" "fcgi://php:9000/usr/local/apache2/htdocs/web/" timeout=300
Oops, something went wrong.

0 comments on commit 3716bf3

Please sign in to comment.