This image is build using Ubuntu 14.04 with Nginx and PHP 5.5.9 and is optimized to run Drupal 7. It can run Drupal 6 but most likely you'll have PHP errors depending on the modules you have installed. In that case is recommended to use the image iiiepe/nginx-drupal6 or iiiepe/apache-drupal6
Includes:
- nginx
- php
- composer
- drush
Important:
- Logs are at /var/log/supervisor so you can map that directory
- Application root directory is /var/www so make sure you map the application there
- Nginx configuration was provided by https://github.com/perusio/drupal-with-nginx but it's modified
$ make build
or
$ docker build -t yourname/nginx-drupal .
$ docker pull devsu/nginx-drupal7
Nginx will look for files in /var/www so you need to map your application to that directory.
$ docker run -d -p 8000:80 -v application:/var/www yourname/nginx-drupal
If you want to link the container to a MySQL/MariaDB container do:
$ docker run -d -p 8000:80 -v application:/var/www my_mysql_container:mysql yourname/nginx-drupal
The startup.sh script will add the environment variables with MYSQL_ to /etc/php5/fpm/pool.d/env.conf so PHP-FPM detects them. If you need to use them you can do:
mysql:
image: mysql
expose:
- "3306"
environment:
MYSQL_ROOT_PASSWORD: my-secret-pass
web:
image: iiiepe/nginx-drupal
volumes:
- application:/var/www
- logs:/var/log/supervisor
ports:
- "80:80"
links:
- "mysql:mysql"
Recommended to be used behind a reverse-proxy like jwilder/nginx-proxy
$ docker run -d -v application:/var/www my_mysql_container:mysql devsu/nginx-drupal7
$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
sendmail usually requires an specific HOSTNAME, run like this:
$ docker run -d -h example.com -v application:/var/www my_mysql_container:mysql devsu/nginx-drupal7
To specify cron schedule you can set the variable CRON_SCHEDULE
to the desired settings. Like this:
$ docker run -d -e CRON_SCHEDULE="10 * * * *" -v application:/var/www my_mysql_container:mysql devsu/nginx-drupal7
The default value is "*/15 * * * *" (Every fifteen minutes)
Changes from base image iiiepe/docker-nginx-drupal
-
Slightly smaller image size
-
sendmail instead of msmtp, in foreground
-
Removed /var/www/site/default/file volume for convenience
-
php5-fpm in foreground with -D option
Released under the MIT License.