/drupal-nginx-fpm

Primary LanguageShellMIT LicenseMIT

Drupal-nginx-php Docker

This is a Drupal Docker image which can run on both

You can find it in Docker hub here https://hub.docker.com/r/appsvcorg/drupal-nginx-fpm/

Components

This docker image currently contains the following components:

  1. Drupal (8.5.1)
  2. nginx (1.13.8)
  3. PHP (7.0.27)
  4. Drush
  5. Composer (1.6.1)
  6. MariaDB ( 10.1.26/if using Local Database )
  7. Phpmyadmin ( 4.7.7/if using Local Database )

How to Deploy to Azure

  1. Create a Web App for Containers, set Docker container as appsvcorg/drupal-nginx-fpm:0.2 OR: Create a Drupal on Linux Web App With MySQL.
  2. Update App Setting WEBSITES_ENABLE_APP_SERVICE_STORAGE = true

If the WEBSITES_ENABLE_APP_SERVICE_STORAGE setting is false, the /home/ directory will not be shared across scale instances, and files that are written there will not be persisted across restarts.

  1. Add one App Setting WEBSITES_CONTAINER_START_TIME_LIMIT = 600
  2. Browse your site and wait almost 10 mins, you will see install page of Drupal.
  3. Complete Drupal install.

How to configure to use Local Database with web app

  1. Create a Web App for Containers
  2. Update App Setting WEBSITES_ENABLE_APP_SERVICE_STORAGE = true
  3. 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 **
  1. Browse http://[website]/phpmyadmin

Limitations

  • Must include App Setting WEBSITES_ENABLE_APP_SERVICE_STORAGE = true since we need files to be persisted. Do not use local storage for Drupal. You can use local storage for transient data or cached data say /tmp folder.
  • 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 600.

Change Log

  • Version 0.2
    1. Supports local MySQL.
    2. Create default database - azurelocaldb.(You need set DATABASE_TYPE to "local")
    3. 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>
    4. Fixed Restart block issue.

How to Contribute

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.