From 2c9444344bafa6e27b4ac061fffc676ea5b6bf3d Mon Sep 17 00:00:00 2001 From: Amit Sharma Date: Wed, 22 Jul 2020 11:25:20 +0530 Subject: [PATCH] Checkin Mailhog in all staarterkits and changed the dependency of chown service. --- starterkits/drupal8-php-fpm-apache/Readme.md | 14 ++++++-- .../drupal8-php-fpm-apache/docker-compose.yml | 6 ++-- starterkits/drupal8-php-fpm-nginx/Readme.md | 24 +++++++++++++ starterkits/drupal8-php-fpm-nginx/Tiltfile | 8 +++-- .../drupal8-php-fpm-nginx/docker-compose.yml | 34 +++++++++++-------- starterkits/drupal9-php-fpm-apache/Readme.md | 29 ++++++++++++++-- starterkits/drupal9-php-fpm-apache/Tiltfile | 8 +++-- .../drupal9-php-fpm-apache/docker-compose.yml | 31 +++++++++-------- starterkits/drupal9-php-fpm-nginx/Readme.md | 25 ++++++++++++++ starterkits/drupal9-php-fpm-nginx/Tiltfile | 8 +++-- .../drupal9-php-fpm-nginx/docker-compose.yml | 34 +++++++++++-------- .../ezcontent8-php-fpm-apache/Readme.md | 14 +++++++- .../docker-compose.yml | 6 ++-- 13 files changed, 180 insertions(+), 61 deletions(-) diff --git a/starterkits/drupal8-php-fpm-apache/Readme.md b/starterkits/drupal8-php-fpm-apache/Readme.md index 682ee14..13a4e19 100644 --- a/starterkits/drupal8-php-fpm-apache/Readme.md +++ b/starterkits/drupal8-php-fpm-apache/Readme.md @@ -13,8 +13,7 @@ are documented in the table below. | Project name | .env | PROJECT_NAME | drupal8 | --- -**NOTE** - +## NOTE: Due to an issue as of now PHP_VERSION has to be updated in Tiltfile as well. --- @@ -81,6 +80,17 @@ recommended alias: alias ddrush="docker-compose run --rm drupal drush" ``` --- +## NOTE: +``` +Problem: + On Linux OS, during composer install cli service throws + a permission denied error while installing dependencies. + +Solution: + Run the cli service with root user and run chown service after to change the ownership. + This will prevent the error throws during the composer install. +``` +--- ## Profiling All the starterkits in vega are shipped with blackfire for code profiling. This is also available on diff --git a/starterkits/drupal8-php-fpm-apache/docker-compose.yml b/starterkits/drupal8-php-fpm-apache/docker-compose.yml index e3082af..0807a25 100644 --- a/starterkits/drupal8-php-fpm-apache/docker-compose.yml +++ b/starterkits/drupal8-php-fpm-apache/docker-compose.yml @@ -42,16 +42,16 @@ services: command: - "chown -R continua:continua /app" user: root + depends_on: + - cli volumes: *app-volumes cli: image: "srijanlabs/php-cli:${PHP_VERSION}-10" container_name: ${PROJECT_NAME}_cli command: ["composer", "install", "--no-dev", "--prefer-dist", "--no-progress", "--no-suggest", "--no-interaction", "--optimize-autoloader"] - user: continua + user: user working_dir: /app - depends_on: - - chown volumes: *cli-volumes networks: *app-networks env_file: *app-envsfile diff --git a/starterkits/drupal8-php-fpm-nginx/Readme.md b/starterkits/drupal8-php-fpm-nginx/Readme.md index 559d40a..b75bdbc 100644 --- a/starterkits/drupal8-php-fpm-nginx/Readme.md +++ b/starterkits/drupal8-php-fpm-nginx/Readme.md @@ -6,6 +6,11 @@ | PHP version | .env | PHP_VERSION | 7.3 | | Project name | .env | PROJECT_NAME | drupal8 | +--- +## NOTE: +Due to an issue as of now PHP_VERSION has to be updated in Tiltfile as well. +--- + ### Configuring Runtime: ##### These values can be configure using [.env](.env) file @@ -68,6 +73,18 @@ recommended alias: alias ddrush="docker-compose run --rm php drush" ``` --- +## NOTE: +``` +Problem: + On Linux OS, during composer install cli service throws + a permission denied error while installing dependencies. + +Solution: + Run the cli service with root user and run chown service after to change the ownership. + This will prevent the error throws during the composer install. +``` +--- + ### Profiling: - Get your blackfire server id and token from https://blackfire.io/my/settings/credentials - Configure the blackfire server id and token in .env file. @@ -87,3 +104,10 @@ alias ddrush="docker-compose run --rm php drush" Please follow the document to setup xdebug: [Setup Xdebug](/starterkits/XDEBUG-SETUP.md) + +## Mailhog + +This starterkit ships with mailhog which can be accessed at localhost:8025. This can be a handy feature +to test email functionality on local systems without worrying about sending mails accidently to real users. +Mailhog is only available on dev images which are used for local development and not available on production +images. diff --git a/starterkits/drupal8-php-fpm-nginx/Tiltfile b/starterkits/drupal8-php-fpm-nginx/Tiltfile index 829bab6..757b558 100644 --- a/starterkits/drupal8-php-fpm-nginx/Tiltfile +++ b/starterkits/drupal8-php-fpm-nginx/Tiltfile @@ -1,9 +1,13 @@ # -*- mode: Python -*- docker_compose('docker-compose.yml') -php_version = str(local('source .env && echo $PHP_VERSION')).strip() +# php_version = str(local('source .env && echo $PHP_VERSION')).strip(). @TODO: This does not +# work on some systems, hence for workaround php_version is hardcoded. +# Change this in case you want to use someother version of php(supported: 7.2, 7.3 & .7.4). +# Please ensure to change PHP_VERSION in .env file as well. +php_version = "7.3" docker_build('srijanlabs/php-fpm-nginx:' + php_version + '-10-local', '.', - build_arg={'PHP_VERSION': php_version}, + build_args={'PHP_VERSION': php_version}, dockerfile='Dockerfile.dev', live_update = [ sync('.', '/app'), diff --git a/starterkits/drupal8-php-fpm-nginx/docker-compose.yml b/starterkits/drupal8-php-fpm-nginx/docker-compose.yml index 9d186d2..6a12a3b 100644 --- a/starterkits/drupal8-php-fpm-nginx/docker-compose.yml +++ b/starterkits/drupal8-php-fpm-nginx/docker-compose.yml @@ -1,6 +1,6 @@ -#========================================= Drupal 8 StarterKit =============================================# +# Drupal 8 + Nginx StarterKit with nginx. version: '3.5' -#____________________________________________ Named Volumes ________________________________________________# + volumes: app: driver: local @@ -13,11 +13,11 @@ volumes: # core: # drupal core # vendor: # php modules files: # files -#______________________________________________ Networks ___________________________________________________# + networks: default: name: vega-${PROJECT_NAME} -#___________________________________________ YAML extensions _______________________________________________# + x-app-volumes: &app-volumes - files:${DOC_ROOT}/sites/default/files:delegated # - ./:/app:cached @@ -34,9 +34,7 @@ x-app-envsfile: &app-envsfile .env x-app-networks: &app-networks - default -#_______________________________________________ Services __________________________________________________# services: - #----------------------------- permission setter ------------------------------------# # Change mounted named volumes user from root(default) to continua. chown: image: "srijanlabs/php-cli:${PHP_VERSION}-10" @@ -45,22 +43,22 @@ services: command: - "chown -R continua:continua /app" user: root + depends_on: + - cli volumes: *app-volumes - #---------------------------------- php cli -----------------------------------------# + cli: image: "srijanlabs/php-cli:${PHP_VERSION}-10" container_name: ${PROJECT_NAME}_cli command: ["composer", "install", "--no-dev", "--prefer-dist", "--no-progress", "--no-suggest", "--no-interaction", "--optimize-autoloader"] - user: continua + user: root working_dir: /app - depends_on: - - chown volumes: *cli-volumes networks: *app-networks env_file: *app-envsfile environment: - COMPOSER_MEMORY_LIMIT=-1 # Prevent composer from running out of memory - #---------------------------------- php-fpm -----------------------------------------# + php: image: srijanlabs/php-fpm-nginx:${PHP_VERSION}-10-local build: @@ -76,7 +74,7 @@ services: volumes: *app-volumes networks: *app-networks env_file: *app-envsfile - #---------------------------------- nginx ------------------------------------------# + nginx: image: srijanlabs/php-fpm-nginx:${PHP_VERSION}-10-local container_name: ${PROJECT_NAME}_nginx @@ -88,7 +86,7 @@ services: volumes: *app-volumes networks: *app-networks env_file: *app-envsfile - #------------------------------- database (mysql) -----------------------------------# + mysql: image: mysql:5.7 container_name: ${PROJECT_NAME}_mysql @@ -102,7 +100,13 @@ services: MYSQL_PASSWORD: ${DB_PASSWORD} MYSQL_DATABASE: ${DB_NAME} networks: *app-networks - #------------------------------- blackfire -----------------------------------# + + mailhog: + image: mailhog/mailhog + ports: + - "1025:1025" + - "8025:8025" + # blackfire: # image: blackfire/blackfire # container_name: ${PROJECT_NAME}_blackfire @@ -113,4 +117,4 @@ services: # BLACKFIRE_SERVER_ID: ${BLACKFIRE_SERVER_ID} # BLACKFIRE_SERVER_TOKEN: ${BLACKFIRE_SERVER_TOKEN} # networks: *app-networks -#===========================================================================================================# + diff --git a/starterkits/drupal9-php-fpm-apache/Readme.md b/starterkits/drupal9-php-fpm-apache/Readme.md index 2c9245a..6cb7d96 100644 --- a/starterkits/drupal9-php-fpm-apache/Readme.md +++ b/starterkits/drupal9-php-fpm-apache/Readme.md @@ -6,6 +6,11 @@ | PHP version | .env | PHP_VERSION | 7.3 | | Project name | .env | PROJECT_NAME | drupal9 | +--- +## NOTE: +Due to an issue as of now PHP_VERSION has to be updated in Tiltfile as well. +--- + ### Configuring Runtime: ##### These values can be configure using [.env](.env) file @@ -61,13 +66,26 @@ alias dcomposer="docker-compose run --rm cli composer" --- ### Running drush commands: ```bash -docker-compose run --rm php drush cr +docker-compose run --rm drupal drush cr ``` recommended alias: ```bash -alias ddrush="docker-compose run --rm php drush" +alias ddrush="docker-compose run --rm drupal drush" ``` --- + +## NOTE: +``` +Problem: + On Linux OS, during composer install cli service throws + a permission denied error while installing dependencies. + +Solution: + Run the cli service with root user and run chown service after to change the ownership. + This will prevent the error throws during the composer install. +``` +--- + ### Profiling: - Get your blackfire server id and token from https://blackfire.io/my/settings/credentials - Configure the blackfire server id and token in .env file. @@ -88,3 +106,10 @@ alias ddrush="docker-compose run --rm php drush" Please follow the document to setup xdebug: [Setup Xdebug](/starterkits/XDEBUG-SETUP.md) + +## Mailhog + +This starterkit ships with mailhog which can be accessed at localhost:8025. This can be a handy feature +to test email functionality on local systems without worrying about sending mails accidently to real users. +Mailhog is only available on dev images which are used for local development and not available on production +images. diff --git a/starterkits/drupal9-php-fpm-apache/Tiltfile b/starterkits/drupal9-php-fpm-apache/Tiltfile index 6585714..1f15f10 100644 --- a/starterkits/drupal9-php-fpm-apache/Tiltfile +++ b/starterkits/drupal9-php-fpm-apache/Tiltfile @@ -1,9 +1,13 @@ # -*- mode: Python -*- docker_compose('docker-compose.yml') -php_version = str(local('source .env && echo $PHP_VERSION')).strip() +# php_version = str(local('source .env && echo $PHP_VERSION')).strip(). @TODO: This does not +# work on some systems, hence for workaround php_version is hardcoded. +# Change this in case you want to use someother version of php(supported: 7.2, 7.3 & .7.4). +# Please ensure to change PHP_VERSION in .env file as well. +php_version = "7.3" docker_build('srijanlabs/php-fpm-apache:' + php_version + '-10-local', '.', - build_arg={'PHP_VERSION': php_version}, + build_args={'PHP_VERSION': php_version}, dockerfile='Dockerfile.dev', live_update = [ sync('.', '/app'), diff --git a/starterkits/drupal9-php-fpm-apache/docker-compose.yml b/starterkits/drupal9-php-fpm-apache/docker-compose.yml index 18e4470..3b0c347 100644 --- a/starterkits/drupal9-php-fpm-apache/docker-compose.yml +++ b/starterkits/drupal9-php-fpm-apache/docker-compose.yml @@ -1,6 +1,6 @@ -#========================================= Drupal 9 StarterKit =============================================# +# Drupal 9 StarterKit with Nginx. version: '3.5' -#____________________________________________ Named Volumes ________________________________________________# + volumes: app: driver: local @@ -13,11 +13,11 @@ volumes: # core: # drupal core # vendor: # php modules files: # files -#______________________________________________ Networks ___________________________________________________# + networks: default: name: vega-${PROJECT_NAME} -#___________________________________________ YAML extensions _______________________________________________# + x-app-volumes: &app-volumes - files:${DOC_ROOT}/sites/default/files:delegated # - ./:/app:cached @@ -34,9 +34,7 @@ x-app-envsfile: &app-envsfile .env x-app-networks: &app-networks - default -#_______________________________________________ Services __________________________________________________# services: - #----------------------------- permission setter ------------------------------------# # Change mounted named volumes user from root(default) to continua. chown: image: "srijanlabs/php-cli:${PHP_VERSION}-10" @@ -45,22 +43,22 @@ services: command: - "chown -R continua:continua /app" user: root + depends_on: + - cli volumes: *app-volumes - #---------------------------------- php cli -----------------------------------------# + cli: image: "srijanlabs/php-cli:${PHP_VERSION}-10" container_name: ${PROJECT_NAME}_cli command: ["composer", "install", "--no-dev", "--prefer-dist", "--no-progress", "--no-suggest", "--no-interaction", "--optimize-autoloader"] - user: continua + user: root working_dir: /app - depends_on: - - chown volumes: *cli-volumes networks: *app-networks env_file: *app-envsfile environment: - COMPOSER_MEMORY_LIMIT=-1 # Prevent composer from running out of memory - #---------------------------------- drupal ------------------------------------------# + drupal: image: srijanlabs/php-fpm-apache:${PHP_VERSION}-10-local build: @@ -76,7 +74,7 @@ services: volumes: *app-volumes networks: *app-networks env_file: *app-envsfile - #------------------------------- database (mysql) -----------------------------------# + mysql: image: mysql:5.7 container_name: ${PROJECT_NAME}_mysql @@ -90,7 +88,13 @@ services: MYSQL_PASSWORD: ${DB_PASSWORD} MYSQL_DATABASE: ${DB_NAME} networks: *app-networks - #------------------------------- blackfire -----------------------------------# + + mailhog: + image: mailhog/mailhog + ports: + - "1025:1025" + - "8025:8025" + # blackfire: # image: blackfire/blackfire # container_name: ${PROJECT_NAME}_blackfire @@ -101,4 +105,3 @@ services: # BLACKFIRE_SERVER_ID: ${BLACKFIRE_SERVER_ID} # BLACKFIRE_SERVER_TOKEN: ${BLACKFIRE_SERVER_TOKEN} # networks: *app-networks -#===========================================================================================================# diff --git a/starterkits/drupal9-php-fpm-nginx/Readme.md b/starterkits/drupal9-php-fpm-nginx/Readme.md index 9c1d661..1529dc1 100644 --- a/starterkits/drupal9-php-fpm-nginx/Readme.md +++ b/starterkits/drupal9-php-fpm-nginx/Readme.md @@ -6,6 +6,11 @@ | PHP version | .env | PHP_VERSION | 7.3 | | Project name | .env | PROJECT_NAME | drupal9 | +--- +## NOTE: +Due to an issue as of now PHP_VERSION has to be updated in Tiltfile as well. +--- + ### Configuring Runtime: ##### These values can be configure using [.env](.env) file @@ -68,6 +73,19 @@ recommended alias: alias ddrush="docker-compose run --rm php drush" ``` --- +--- +## NOTE: +``` +Problem: + On Linux OS, during composer install cli service throws + a permission denied error while installing dependencies. + +Solution: + Run the cli service with root user and run chown service after to change the ownership. + This will prevent the error throws during the composer install. +``` +--- + ### Profiling: - Get your blackfire server id and token from https://blackfire.io/my/settings/credentials - Configure the blackfire server id and token in .env file. @@ -87,3 +105,10 @@ alias ddrush="docker-compose run --rm php drush" Please follow the document to setup xdebug: [Setup Xdebug](/starterkits/XDEBUG-SETUP.md) + +## Mailhog + +This starterkit ships with mailhog which can be accessed at localhost:8025. This can be a handy feature +to test email functionality on local systems without worrying about sending mails accidently to real users. +Mailhog is only available on dev images which are used for local development and not available on production +images. diff --git a/starterkits/drupal9-php-fpm-nginx/Tiltfile b/starterkits/drupal9-php-fpm-nginx/Tiltfile index 829bab6..757b558 100644 --- a/starterkits/drupal9-php-fpm-nginx/Tiltfile +++ b/starterkits/drupal9-php-fpm-nginx/Tiltfile @@ -1,9 +1,13 @@ # -*- mode: Python -*- docker_compose('docker-compose.yml') -php_version = str(local('source .env && echo $PHP_VERSION')).strip() +# php_version = str(local('source .env && echo $PHP_VERSION')).strip(). @TODO: This does not +# work on some systems, hence for workaround php_version is hardcoded. +# Change this in case you want to use someother version of php(supported: 7.2, 7.3 & .7.4). +# Please ensure to change PHP_VERSION in .env file as well. +php_version = "7.3" docker_build('srijanlabs/php-fpm-nginx:' + php_version + '-10-local', '.', - build_arg={'PHP_VERSION': php_version}, + build_args={'PHP_VERSION': php_version}, dockerfile='Dockerfile.dev', live_update = [ sync('.', '/app'), diff --git a/starterkits/drupal9-php-fpm-nginx/docker-compose.yml b/starterkits/drupal9-php-fpm-nginx/docker-compose.yml index 88b454a..de1d9a4 100644 --- a/starterkits/drupal9-php-fpm-nginx/docker-compose.yml +++ b/starterkits/drupal9-php-fpm-nginx/docker-compose.yml @@ -1,6 +1,6 @@ -#========================================= Drupal 9 StarterKit =============================================# +# Drupal 9 StarterKit with nginx. version: '3.5' -#____________________________________________ Named Volumes ________________________________________________# + volumes: app: driver: local @@ -13,11 +13,11 @@ volumes: # core: # drupal core # vendor: # php modules files: # files -#______________________________________________ Networks ___________________________________________________# + networks: default: name: vega-${PROJECT_NAME} -#___________________________________________ YAML extensions _______________________________________________# + x-app-volumes: &app-volumes - files:${DOC_ROOT}/sites/default/files:delegated # - ./:/app:cached @@ -34,9 +34,7 @@ x-app-envsfile: &app-envsfile .env x-app-networks: &app-networks - default -#_______________________________________________ Services __________________________________________________# services: - #----------------------------- permission setter ------------------------------------# # Change mounted named volumes user from root(default) to continua. chown: image: "srijanlabs/php-cli:${PHP_VERSION}-10" @@ -45,22 +43,22 @@ services: command: - "chown -R continua:continua /app" user: root + depends_on: + - cli volumes: *app-volumes - #---------------------------------- php cli -----------------------------------------# + cli: image: "srijanlabs/php-cli:${PHP_VERSION}-10" container_name: ${PROJECT_NAME}_cli command: ["composer", "install", "--no-dev", "--prefer-dist", "--no-progress", "--no-suggest", "--no-interaction", "--optimize-autoloader"] - user: continua + user: root working_dir: /app - depends_on: - - chown volumes: *cli-volumes networks: *app-networks env_file: *app-envsfile environment: - COMPOSER_MEMORY_LIMIT=-1 # Prevent composer from running out of memory - #---------------------------------- php-fpm -----------------------------------------# + php: image: srijanlabs/php-fpm-nginx:${PHP_VERSION}-10-local build: @@ -76,7 +74,7 @@ services: volumes: *app-volumes networks: *app-networks env_file: *app-envsfile - #---------------------------------- nginx ------------------------------------------# + nginx: image: srijanlabs/php-fpm-nginx:${PHP_VERSION}-10-local container_name: ${PROJECT_NAME}_nginx @@ -88,7 +86,7 @@ services: volumes: *app-volumes networks: *app-networks env_file: *app-envsfile - #------------------------------- database (mysql) -----------------------------------# + mysql: image: mysql:5.7 container_name: ${PROJECT_NAME}_mysql @@ -102,7 +100,13 @@ services: MYSQL_PASSWORD: ${DB_PASSWORD} MYSQL_DATABASE: ${DB_NAME} networks: *app-networks - #------------------------------- blackfire -----------------------------------# + + mailhog: + image: mailhog/mailhog + ports: + - "1025:1025" + - "8025:8025" + # blackfire: # image: blackfire/blackfire # container_name: ${PROJECT_NAME}_blackfire @@ -113,4 +117,4 @@ services: # BLACKFIRE_SERVER_ID: ${BLACKFIRE_SERVER_ID} # BLACKFIRE_SERVER_TOKEN: ${BLACKFIRE_SERVER_TOKEN} # networks: *app-networks -#===========================================================================================================# + diff --git a/starterkits/ezcontent8-php-fpm-apache/Readme.md b/starterkits/ezcontent8-php-fpm-apache/Readme.md index 9547e7a..590b0fe 100644 --- a/starterkits/ezcontent8-php-fpm-apache/Readme.md +++ b/starterkits/ezcontent8-php-fpm-apache/Readme.md @@ -13,7 +13,7 @@ are documented in the table below. | Project name | .env | PROJECT_NAME | drupal8 | --- -**NOTE** +## NOTE: Due to an issue as of now PHP_VERSION has to be updated in Tiltfile as well. --- @@ -81,6 +81,18 @@ recommended alias: alias ddrush="docker-compose run --rm drupal drush" ``` --- +## NOTE: +``` +Problem: + On Linux OS, during composer install cli service throws + a permission denied error while installing dependencies. + +Solution: + Run the cli service with root user and run chown service after to change the ownership. + This will prevent the error throws during the composer install. +``` +--- + ## Profiling All the starterkits in vega are shipped with blackfire for code profiling. This is also available on the dev images and is not added to production images. diff --git a/starterkits/ezcontent8-php-fpm-apache/docker-compose.yml b/starterkits/ezcontent8-php-fpm-apache/docker-compose.yml index ccc2120..b77a1cc 100644 --- a/starterkits/ezcontent8-php-fpm-apache/docker-compose.yml +++ b/starterkits/ezcontent8-php-fpm-apache/docker-compose.yml @@ -46,16 +46,16 @@ services: command: - "chown -R continua:continua /app" user: root + depends_on: + - cli volumes: *app-volumes cli: image: "srijanlabs/php-cli:${PHP_VERSION}-10" container_name: ${PROJECT_NAME}_cli command: ["composer", "install", "--no-dev", "--prefer-dist", "--no-progress", "--no-suggest", "--no-interaction", "--optimize-autoloader"] - user: continua + user: root working_dir: /app - depends_on: - - chown volumes: *cli-volumes networks: *app-networks env_file: *app-envsfile