Nginx container for local development matching Acquia structure.
2.5K
Table of Contents generated with DocToc
This image is build using Ubuntu 14.04 with Nginx and PHP 5.5.9 and is optimized to run Drupal 7 and it is designed to use the docroot which is how Acquia repositories are setup if you are hosting your production site on Acquia.
** This is not intended to be a production ready instance. My current use is for local development with sites being hosted on Acquia Cloud. **
This repo is a fork of: https://github.com/iiiepe/docker-nginx-drupal if your site does not use docroot format this container maybe a better option.
Drupal Site Code must be located /var/www/docroot
$ make build
or
$ docker build -t yourname/nginx-drupal .
Nginx will look for files in /var/www so you need to map your application to that directory.
The actual site will be run from /var/www/docroot
docker run -d -p 8000:80 -v application:/var/www yourname/nginx-drupal
If you want to link the container to a MySQL/MariaDB contaier 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:
docker run -d -e PHP_OPCACHE=enabled -v "application:/var/www" -v "mountscript.sh:/usr/local/bin/mount.sh" espressodev/nginx-drupal:latest
If you want to use xdebug there is a tag. It sends the connections back to the default docker bridge on port 9000. The debug key is dgbp
docker run -d -e PHP_OPCACHE=disabled -v "application:/var/www" -v "mountscript.sh:/usr/local/bin/mount.sh" espressodev/nginx-drupal:xdebug
IF PEAR IS DOWN In the temporary to get drush running there is a copy of the console table on my repo in github. It can be downloaded and installed in the package location
cd /tmp
curl -O https://raw.githubusercontent.com/ianlintner-wf/drush_console_table/master/Table.php
mkdir -p ~/.composer/vendor/drush/drush/lib/Console_Table-1.1.3/
cp Table.php ~/.composer/vendor/drush/drush/lib/Console_Table-1.1.3/Table.php
AKA Docker Compose
mysql:
image: mysql
expose:
- "3306"
environment:
MYSQL_ROOT_PASSWORD: 123
web:
image: espressodev/nginx-drupal
volumes:
- application:/var/www
- logs:/var/log/supervisor
- mountscript:/usr/local/bin/mount.sh
ports:
- "80:80"
- "443:443"
links:
- "mysql:mysql"
With Fig this is actually easier and is the recommended way since if you're running Docker without fig, you'll have to link all containers before you run drush.
$ fig run --rm web drush
Released under the MIT License.
Content type
Image
Digest
sha256:7b3cebdea…
Size
167.8 MB
Last updated
over 9 years ago
docker pull espressodev/nginx-drupal