This is a Drupal Docker image which can run on both
- Azure Web App on Linux
- Drupal on Linux Web App With MySQL
- Your Docker engines's host.
You can find it in Docker hub here https://hub.docker.com/r/appsvcorg/drupal-nginx-fpm/
This docker image currently contains the following components:
- Drupal (Git pull as you wish)
- nginx (1.14.0)
- PHP (7.2.11)
- Drush
- Composer (1.7.2)
- MariaDB ( 10.1.26/if using Local Database )
- Phpmyadmin ( 4.8.0/if using Local Database )
- Create a Web App for Containers, set Docker container as
appsvcorg/drupal-nginx-fpm:php7.2.9
OR: Create a Drupal on Linux Web App With MySQL. - Add one App Setting
WEBSITES_CONTAINER_START_TIME_LIMIT
= 900 - Browse your site and wait almost 10 mins, you will see install page of Drupal.
- Complete Drupal install.
- Create a Web App for Containers
- Add new App Settings
Name | Default Value |
---|---|
GIT_REPO | https://github.com/azureappserviceoss/drupalcms-composer-azure |
GIT_BRANCH | master |
- Browse your site
Note: GIT directory: /home/site/wwwroot.
Note:
WEBSITES_ENABLE_APP_SERVICE_STORAGE
= false, Before restart web app, need to store your changes by "git push", it will be pulled again after restart.Note:
WEBSITES_ENABLE_APP_SERVICE_STORAGE
= true, and /home/site/wwwroot/sites/default/settings.php is exist, it will not pull again after restart.
- Create a Web App for Containers
- Update App Setting
WEBSITES_ENABLE_APP_SERVICE_STORAGE
= true - Add new App Settings
Name | Default Value |
---|---|
DATABASE_TYPE | local |
DATABASE_USERNAME | some-string |
DATABASE_PASSWORD | some-string |
Note: We create a database "azurelocaldb" when using local mysql. Hence use this name when setting up the app.
- Browse http://[website]/phpmyadmin
- By default Xdebug is turned off as turning it on impacts performance.
- Connect by SSH.
- Go to
/usr/local/etc/php/conf.d
, Updatexdebug.ini
as wish, don't modify the path of below line.zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so
- Save
xdebug.ini
, Restart php-fpm by below cmd:
# find gid of php-fpm
ps aux
# Kill master process of php-fpm
kill -INT <gid>
# start php-fpm again
php-fpm -D
chmod 777 /run/php/php7.0-fpm.sock
- Xdebug is turned on.
If WEBSITES_ENABLE_APP_SERVICE_STORAGE
= false ( which is the default setting ), we recommend you DO NOT update the Drupal core version, themes or files.
There is a tradeoff between file server stability and file persistence. Choose either one option to updated your files:
Since we are using local storage for better stability for the web app , you will not get file persistence. In this case , we recommend to follow these steps to update WordPress Core or a theme or a Plugins version:
- Fork the repo https://github.com/azureappserviceoss/drupalcms-composer-azure
- Clone your repo locally
- Download the latest version of Drupal , plugin or theme being used locally
- Commit the latest version bits into local folder of your cloned repo
- Push your changes to the your forked repo
- Login to Azure portal and select your web app
- Click on Application Settings -> App Settings and change GIT_REPO to use your repository from step #1. If you haven't changed the branch name, you can continue to use linuxapservice. If you wish to use a different branch, update GIT_BRANCH setting as well.
You can update WEBSITES_ENABLE_APP_SERVICE_STORAGE
= true to enable app service storage to have file persistence. Note when there are issues with storage due to networking or when app service platform is being updated, your app can be impacted.
You can use below composer cmds to install theme/modules.
cd /home/drupal-prj
composer require drupal/redis
composer require drupal/adminimal_theme
- Must include App Setting
WEBSITES_ENABLE_APP_SERVICE_STORAGE
= true as soon as you need files to be persisted. - Deploy to Azure, Pull and run this image need some time, You can include App Setting
WEBSITES_CONTAINER_START_TIME_LIMIT
to specify the time in seconds as need, Default is 240 and max is 1800, suggest to set it as 900 when using this version.
- Version 0.46
- Update php settings, php memory = 512M.
- Version 0.45
- Update php codes, it can fill database parameters automatically if deploy to azure by template.
- Version 0.44-composer-varnish
- Add Varnish, improve performance.
- Use 'Git pull' to get drupal project codes form another repo, support composer better.
- Add selectable listen type of php-fpm/nginx.
- Version 0.44
- Update Version of PHP to 7.2.11.
- Increase php max excute time and memory size.
- Update Version of Composer to 1.72.1.
- Include composer require-dev.
- Abandon Redis from this version.
- Version 0.43-composer
- Use "composer create-project" to download latest drupal core. More Informatio
- Update composer by entrypoint.sh, always keep it as latest.
- Version 0.43
- Installed php extension redis, and local redis-server.
- Fix the bug of Drush.
- Version 0.42
- Update settings of opcache, more stable.
- Version 0.41
- Reduce size.
- Update version php-fpm.
- Version 0.4
- Base image to alpine, reduce size.
- Update version of nginx and php-fpm.
- Update conf files of php-fpm, pass env parameters by default.
- Update conf files of nignx.
- Version 0.31
- Install some common debug tools, netstat, tcpping, tcpdump.
- Version 0.3
- Use Git to deploy Drupal.
- Add Xdebug extension of PHP.
- Update version of nginx to 1.13.11.
- Update version of phpmyadmin to 4.8.0.
- Version 0.2
- Supports local MySQL.
- Create default database - azurelocaldb.(You need set DATABASE_TYPE to "local")
- Considering security, please set database authentication info on "App settings" when enable "local" mode.
Note: the credentials below is also used by phpMyAdmin.
- DATABASE_USERNAME | <your phpMyAdmin user>
- DATABASE_PASSWORD | <your phpMyAdmin password>
- Fixed Restart block issue.
If you have feedback please create an issue but do not send Pull requests to these images since any changes to the images needs to tested before it is pushed to production.