Coder Social home page Coder Social logo

docker4drupal's Introduction

Docker-based Drupal stack

Build Status

Introduction

Docker4Drupal is a set of docker images optimized for Drupal. Use compose.yml file from the latest stable release to spin up local environment on Linux, Mac OS X and Windows.

Stack

The Drupal stack consist of the following containers:

Container Versions Image ARM64 support Enabled by default
Nginx 1.27, 1.26 wodby/nginx
Apache 2.4 wodby/apache
Drupal 10, 7 wodby/drupal
PHP 8.3, 8.2, 8.1 wodby/drupal-php
Crond wodby/drupal-php
MariaDB 11, 10.11, 10.6, 10.5, 10.4 wodby/mariadb
PostgreSQL 16, 15, 14, 13, 12 wodby/postgres
Valkey 7 wodby/valkey
Memcached 1 wodby/memcached
Varnish 6.0 wodby/varnish
Node.js 20, 18 wodby/node
Drupal node 1.0 wodby/drupal-node
Solr 8, 7, 6, 5 wodby/solr
Zookeeper 3.8 zookeeper
Elasticsearch 7 wodby/elasticsearch
Kibana 7 wodby/kibana
OpenSMTPD 6.0 wodby/opensmtpd
Mailhog latest mailhog/mailhog
AthenaPDF 2.16.0 arachnysdocker/athenapdf-service
Rsyslog latest wodby/rsyslog
Webgrind 1 wodby/webgrind
Xhprof viewer latest wodby/xhprof
Adminer 4.6 wodby/adminer
phpMyAdmin latest phpmyadmin/phpmyadmin
Selenium chrome 3.141 selenium/standalone-chrome
Traefik latest _/traefik

Supported Drupal versions: 10 / 7

Documentation

Full documentation is available at https://wodby.com/docs/stacks/drupal/local.

Image's tags

Images' tags format is [VERSION]-[STABILITY_TAG] where:

[VERSION] is the version of an application (without patch version) running in a container, e.g. wodby/nginx:1.15-x.x.x where Nginx version is 1.15 and x.x.x is a stability tag. For some images we include both major and minor version like PHP 7.2, for others we include only major like Valkey 7.

[STABILITY_TAG] is the version of an image that corresponds to a git tag of the image repository, e.g. wodby/mariadb:10.2-3.3.8 has MariaDB 10.2 and stability tag 3.3.8. New stability tags include patch updates for applications and image's fixes/improvements (new env vars, orchestration actions fixes, etc). Stability tag changes described in the corresponding a git tag description. Stability tags follow semantic versioning.

We highly encourage to use images only with stability tags.

Maintenance

We regularly update images used in this stack and release them together, see releases page for full changelog and update instructions. Most of routine updates for images and this project performed by the bot via scripts located at wodby/images.

Beyond local environment

Docker4Drupal is a project designed to help you spin up local environment with Docker Compose. If you want to deploy a consistent stack with orchestrations to your own server, check out Drupal stack on Wodby .

Other Docker4x projects

License

This project is licensed under the MIT open source license.

docker4drupal's People

Contributors

abgeo avatar acatejr avatar alesrebec avatar brianv avatar clemens-tolboom avatar cnovak avatar csandanov avatar davo20019 avatar duguillaume avatar duozersk avatar elaman avatar ericmulder1980 avatar fortis avatar heilop avatar irmantasp avatar iryston avatar ivegas avatar jfrederick avatar jsobiecki avatar kasn avatar kwadz avatar larowlan avatar martinfrances107 avatar mogtofu33 avatar niklan avatar pprishchepa avatar shrop avatar siliconmeadow avatar spleshka avatar wodbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker4drupal's Issues

Drupal 7 - Unknown database 'drupal'

I was testing a Drupal 7 setup. I've used the following settings :

database: drupal
username: drupal
password: drupal
host: mariadb

Got :
screenshot-localhost 8000 2016-09-02 15-45-46

Is there a particular port to use ?

Making docker4drupal work with nginx-proxy

hi guys,
This setup is working great for me, except I'm not able to integrate with Nginx Proxy. I have the nginx-proxy container(s) running, and the following configuration for my nginx service:

  nginx:
    image: wodby/drupal-nginx
    environment:
      NGINX_SERVER_NAME: localhost
      NGINX_UPSTREAM_NAME: php
      VIRTUAL_HOST: mydrupalsite.dev
#      NGINX_DOCROOT: public # Relative path inside the /var/www/html/ directory.
      DRUPAL_VERSION: 7 # Allowed: 7, 8.
    volumes_from:
      - php
    ports:
      - "8003:80"

Any help would be appreciated :)

Does not start MariaDB

Windows 7 x64
Docker Toolbox.

logs:

2016-09-12 14:22:45 139718713560104 [Note] mysqld (mysqld 10.1.14-MariaDB) starting as process 1 ...
2016-09-12 14:22:45 139718713560104 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2016-09-12 14:22:45 139718713560104 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-09-12 14:22:45 139718713560104 [Note] InnoDB: The InnoDB memory heap is disabled
2016-09-12 14:22:45 139718713560104 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-09-12 14:22:45 139718713560104 [Note] InnoDB: Memory barrier is not used
2016-09-12 14:22:45 139718713560104 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-09-12 14:22:45 139718713560104 [Note] InnoDB: Using Linux native AIO
2016-09-12 14:22:45 139718713560104 [Note] InnoDB: Using generic crc32 instructions
2016-09-12 14:22:45 139718713560104 [Note] InnoDB: Initializing buffer pool, size = 1.0G
2016-09-12 14:22:46 139718713560104 [Note] InnoDB: Completed initialization of buffer pool
2016-09-12 14:22:46 139718713560104 [Note] InnoDB: Highest supported file format is Barracuda.
2016-09-12 14:22:46 139718713560104 [Note] InnoDB: 128 rollback segment(s) are active.
2016-09-12 14:22:46 139718713560104 [Note] InnoDB: Waiting for purge to start
2016-09-12 14:22:46 139718713560104 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.29-76.2 started; log sequence number 1600749
2016-09-12 14:22:46 139717495040688 [Note] InnoDB: Dumping buffer pool(s) not yet started
2016-09-12 14:22:46 139718713560104 [Note] Plugin 'FEEDBACK' is disabled.
2016-09-12 14:22:46 139718713560104 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2016-09-12 14:22:46 139718713560104 [Note] Recovering after a crash using tc.log
2016-09-12 14:22:46 139718713560104 [ERROR] Can't init tc log
2016-09-12 14:22:46 139718713560104 [ERROR] Aborting

Solr is not set up

When uncommenting solr service from the docker-compose file, Solr starts up, but it's not set up for Drupal - it doesn't have default collection and Drupal settings. I've tried replacing it with wodby/solr-5-alpine - apachesolr module was able to connect. Would that be more suitable solution as that incorporates Drupal configuration?

Composer does not seem to work

Hi !
I am trying to work with docker4drupal on my local environment, based on Windows 10 (using Hyper-V) and Docker 1.12. I would like to use composer to instantiate my project but as interactive mode is not yet supported on Windows, I have to pass the -d flag when using docker-compose exec command.
At the end, following composer command just returns anything and I don't know how to debug:
docker-compose exec -d --user 82 php composer create-project [....]
Do you think this issue is due to my local environment? Has anyone already experimented this kind of issue? Any idea?
Thanks in advance for your support.
Junod

SSH

Is there a way to connect to the local site via SSH?
So that we can work using PuTTY when using Docker for Windows (rather than having to use PowerShell).

Drupal status complaint on HTTP request

On Drupal report status page, this error is reported

Error
    HTTP request status Fails
Your system or network configuration does not allow Drupal to access web pages, resulting in reduced functionality.

Also

Database 4 byte UTF-8 support Not enabled
Upload progress Not enabled

MariaDB fails to start

Hi,

after running docker-compose up I see following errors related to MariaDB:

mariadb_1    | 2016-08-05  8:23:54 139727823449128 [Note] mysqld (mysqld 10.1.14-MariaDB) starting as process 1 ...
mariadb_1    | 2016-08-05  8:23:54 139727823449128 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
mariadb_1    | 2016-08-05  8:23:55 139727823449128 [Note] InnoDB: Using mutexes to ref count buffer pool pages
mariadb_1    | 2016-08-05  8:23:55 139727823449128 [Note] InnoDB: The InnoDB memory heap is disabled
mariadb_1    | 2016-08-05  8:23:55 139727823449128 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mariadb_1    | 2016-08-05  8:23:55 139727823449128 [Note] InnoDB: Memory barrier is not used
mariadb_1    | 2016-08-05  8:23:55 139727823449128 [Note] InnoDB: Compressed tables use zlib 1.2.8
mariadb_1    | 2016-08-05  8:23:55 139727823449128 [Note] InnoDB: Using Linux native AIO
mariadb_1    | 2016-08-05  8:23:55 139727823449128 [Note] InnoDB: Using SSE crc32 instructions
mariadb_1    | 2016-08-05  8:23:55 139727823449128 [Note] InnoDB: Initializing buffer pool, size = 1.0G
mariadb_1    | 2016-08-05  8:23:55 139727823449128 [Note] InnoDB: Completed initialization of buffer pool
mariadb_1    | 2016-08-05  8:23:55 139727823449128 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
mariadb_1    | 2016-08-05  8:23:55 139727823449128 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
mariadb_1    | 2016-08-05  8:23:55 139727823449128 [Note] InnoDB: Database physically writes the file full: wait...
mariadb_1    | 2016-08-05  8:23:56 139727823449128 [Note] InnoDB: Setting log file ./ib_logfile101 size to 32 MB
mariadb_1    | 2016-08-05  8:23:57 139727823449128 [Note] InnoDB: Setting log file ./ib_logfile1 size to 32 MB
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [Warning] InnoDB: New log files created, LSN=45883
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [Note] InnoDB: Doublewrite buffer not found: creating new
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [Note] InnoDB: Doublewrite buffer created
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [Note] InnoDB: 128 rollback segment(s) are active.
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [Warning] InnoDB: Creating foreign key constraint system tables.
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [Note] InnoDB: Foreign key constraint system tables created
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [Note] InnoDB: Creating tablespace and datafile system tables.
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [Note] InnoDB: Tablespace and datafile system tables created.
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [Note] InnoDB: Waiting for purge to start
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.29-76.2 started; log sequence number 0
mariadb_1    | 2016-08-05  8:23:58 139726577355440 [Note] InnoDB: Dumping buffer pool(s) not yet started
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [Note] Plugin 'FEEDBACK' is disabled.
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [Note] Server socket created on IP: '0.0.0.0'.
mariadb_1    | 2016-08-05  8:23:58 139727823449128 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
virgin_mariadb_1 exited with code 1

My docker-compose file is:

version: "2"

services:
  mariadb:
    image: wodby/drupal-mariadb
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: 1
      MYSQL_DATABASE: drupal
      MYSQL_USER: drupal
      MYSQL_PASSWORD: drupal
    volumes:
      - ./docker-runtime/mariadb:/var/lib/mysql
#      - ./docker-runtime/mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.

  php:
    image: wodby/drupal-php:5.6 # Allowed: 7.0, 5.6.
    environment:
      PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
      PHP_XDEBUG_ENABLED: 0 # Set 1 to enable.
    volumes:
      - ./:/var/www/html

  nginx:
    image: wodby/drupal-nginx
    environment:
      NGINX_UPSTREAM_NAME: php
      NGINX_DOCROOT: docroot # Relative path inside the /var/www/html/ directory.
      DRUPAL_VERSION: 7 # Allowed: 7, 8.
    volumes_from:
      - php
    ports:
      - "8000:80"

  pma:
    image: phpmyadmin/phpmyadmin
    restart: always
    environment:
      PMA_HOST: mariadb
      PMA_USER: drupal
      PMA_PASSWORD: drupal
      PHP_UPLOAD_MAX_FILESIZE: 1G
      PHP_MAX_INPUT_VARS: 1G
    ports:
     - "8001:80"

  mailhog:
    image: mailhog/mailhog
    ports:
      - "8002:8025"

  memcached:
    image: memcached:1.4-alpine

  solr:
    image: solr:5.5-alpine
    volumes:
      - ./docker-runtime/solr:/opt/solr/server/solr/mycores
    ports:
      - "8003:8983"

About Xdebug

At the website you mention that if we want to use xdebug, we should uncomment the following line in the compose file:

XDEBUG_CONFIG: xdebug.remote_autostart=1

Unfortunately, this line doesn't exist in the compose file. We must place it under the PHP docker?
Can you provide any info how I could use xdebug with an IDE, for example NetBeans?

Thank you again for your help.

Drupal codebase not downloaded

Does docker4drupal download the Drupal codebase?

I might have missed a step, but this is what I ran:

wget https://raw.githubusercontent.com/Wodby/drupal-compose/master/docker-compose.yml
docker-compose up -d

Going to http://localhost:8000 returns a 404 error with an empty white page saying "File not found."

I wasn't able to find the Drupal codebase in /var/www/html when looking in the nginx container.

Consider methods to build local container to match UID/GID

I was unable to get anything but a File not found when launching your docker-compose.yml.

I was able to make it easy for developers to rebuild a local container so that the web server user matches the UID of their acting local user.

This makes volumes much easier to deal with, and allows users to edit files locally without any permissions issues, or files showing up as owned by root.

Check out our dockerfile for Aegir "local": https://github.com/aegir-project/dockerfiles/blob/master/Dockerfile-local and our prepare.sh script that creates the custom local container: https://github.com/aegir-project/development/blob/master/prepare.sh#L82

docker build --build-arg AEGIR_UID=$USER_UID -t aegir/hostmaster:local -f dockerfiles/Dockerfile-local dockerfiles

With the ARG definition, you are able to accept arguments at docker build time.

I wrote prepare.sh script for our aegir development environment that prepares source code, but most importantly, detects the users UID and runs the right docker build command to create a container just for that user.

Nginx not serving files

Hi everybody!

For some reason Nginx is not serving my files, despite all containers are running. I also can access phpMyAdmin and MailHog through it's respective ports.

Even without making any changes to the docker-compose.yml file Ningx is not serving the files. At least it should show a 404 page... but the only thing I see is ERR_CONNECTION_REFUSED. I think it's not listening.

Here is the list of the running containers:
image

My VPS is on DigitalOcean, with the Docker App image and basically anything else. No firewalls.

Could you help me please? I don't know what else I can do. What am I missing?
Thanks a lot.

Drush Alias is not appearing

See: #13

I just built this project using PHP 5.6, after adding the following to my docker-compose.yml file:

php:
image: wodby/drupal-php:5.6 # Allowed: 7.0, 5.6.
environment:
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
PHP_XDEBUG_ENABLED: 1 # Set 1 to enable.
PHP_SITE_NAME: mydrupalsite.dev
PHP_HOST_NAME: localhost:8000
PHP_DOCROOT: www #set this the same as NGINX_DOCROOT

Using the drush alias commands result in:

[error] Could not find the alias @mydrupalsite.dev

Shelling into the PHP container, I could not locate a drush alias file anywhere in the home directory for the PHP user.

Please advise.

Unresponsive service when requesting resources

This repo looked great, but can't get anywhere yet with it. After running up with only the maria, php and nginx services, I get the following when requesting the CHANGELOG, install.php and a custom added index.html.

b359ceafdecc_docker4drupal_nginx_1 | 172.22.0.1 - - [25/Oct/2016:14:06:53 +0000] "GET /install.php HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
b359ceafdecc_docker4drupal_nginx_1 | 172.22.0.1 - - [25/Oct/2016:14:07:11 +0000] "GET /install.php HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
b359ceafdecc_docker4drupal_nginx_1 | 172.22.0.1 - - [25/Oct/2016:14:07:11 +0000] "GET /CHANGELOG.txt HTTP/1.1" 404 564 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
b359ceafdecc_docker4drupal_nginx_1 | 172.22.0.1 - - [25/Oct/2016:14:07:14 +0000] "GET /CHANGELOG.txt HTTP/1.1" 404 564 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
b359ceafdecc_docker4drupal_nginx_1 | 172.22.0.1 - - [25/Oct/2016:14:07:51 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
b359ceafdecc_docker4drupal_nginx_1 | 172.22.0.1 - - [25/Oct/2016:14:07:51 +0000] "GET /index.html HTTP/1.1" 200 5 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"

When I run docker-compose exec nginx sh I can see the files are there but can only access if I generate a custom index.html, the other 2 resources in example above are not found.

EDIT: While writing this I found that the php resource was eventually loaded, massive delay though. Then the error is that the database is unreachable.

PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2 "No such file or directory") in lock_may_be_available() (line 167 of /var/www/html/includes/lock.inc).

can't execute 'bash': No such file or directory

After getting up and running, if I run $ docker-compose exec php sh I see the following error:
env: can't execute 'bash': No such file or directory

Here's what I see when I run $ docker-compose ps

      Name             Command             State              Ports       
-------------------------------------------------------------------------
demo_mailhog   /MailHog           Up                 1025/tcp, 0.0.0. 
_1                                                       0:8002->8025/tcp 
demo_mariadb   docker-            Up                 3306/tcp         
_1                 entrypoint.sh                                          
                   mysqld                                                 
demo_nginx_1   /bin/sh -c         Up                 443/tcp, 0.0.0.0 
                   "docker-entrypo                       :8000->80/tcp    
                   ...                                                    
demo_php_1     /bin/sh -c         Up                 9000/tcp         
                   docker-entrypoi                                        
                   ...                                                    
demo_pma_1     /run.sh            Up                 0.0.0.0:8001->80 
                   phpmyadmin                            /tcp      

Not sure what I'm doing wrong here...

Interactive mode is not yet supported on Windows

README.md suggests:

You can connect to any container by executing the following command:
$ docker-compose exec php sh

However, I am getting the following error message:
Interactive mode is not yet supported on Windows. Please pass the -d flag when using docker-compose exec.

Run docker-compose exec within a folder

I'm using https://github.com/drupal-composer/drupal-project to build my Drupal structure and I feel this will become more and more of a standard than the one folder structure that you have now if you download Drupal from drupal.org.

The difference is that you get the vendor folder in the root and then the Drupal stuff is inside /web.

I've adjusted the docker-compose.yml PHP_DOCROOT and NGINX_DOCROOT to web, but when I do docker-compose exec --user 82 php drush it doesn't work because it executes at root level.

I know I can connect on the container, cd into web and then run drush, which works, but I'm more interested how I can run all this from my host machine? Obviously the same problem exists with Console.

Bootstrapping question

Given that my Drupal docroot is /var/www/html/drupal8site/web how do I have Drupal Console
associate itself with this docroot?

For example if I wish to install a new site, this command produces an error.

docker-compose exec --user 82 php drupal  --root=/var/www/html/drupal8site/web \
site:install standard --site-name="Drupal 8 via Docker" --langcode=en  \
--db-type=mysql --db-pass=drupal --db-user=drupal --db-port=3306 \
--db-host=mariadb --db-name=drupal \
[email protected]  --acount-name=webmaster \
[email protected] --account-pass=admin

How to Create Multiple databases

Hello. i am using docker4drupal containers for local development. I need to create one more database apart from the default 'drupal'. However phpmyadmin does not have permissions and i do not know the root password to create the database from console. How can i tackle this?

Drupal console not available

Drupal console is not installed. Whenever I try to run it I get:

[ERROR] Drupal Console is not installed at: /var/www/html/
You must execute this composer command:

composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader

PMA container is set to restart always

That means that as soon as Docker for Mac is started (e.g. after the restart) that docker is also restarted although that docker machine is not started.

If that docker machine was stopped with docker-compose down it will not restart by itself.

Also _pma container can be stopped with docker-compose down.

After quitting Docker for Mac app and starting again, _pma was started but with the name of parent directory and I was unable to stop it with docker-compose down but had to use docker kill 451f3b341d4a (id of the container).

Why does _pma has that restart property?

Drush Alias needed when configured an NGINX_DOCROOT

if you configure a doc root for nginx using the NGINX_DOCROOT environment variable, executing drush commands per the instructions in the docs and the readme will no longer work properly, since the drush commands are executed from /var/www/html and not from within the drupal root directory.

This can be solved by setting up a drush alias inside the PHP container for user 82.

For example (file named wodby.aliases.drushrc.php):

<?php $aliases['dev'] = array( 'root' => '/var/www/html/www', #adds the NGINX_DOCROOT to the mounted volume path 'uri' => 'localhost', 'path-aliases' => array( '%site' => 'sites/default/' ), );

where "www" is the NGINX_DOCROOT configured.

Then you execute your drush commands as follows:

docker-compose exec --user 82 php drush @dev <drush-command>

nginx is misconfigured to add query when one doesn't exist

I'm experiencing a problem that I've tracked down to a misconfigured nginx. The symptom is the active class is not added to menu items. This is because the active class code will only add the class if there is no query or a matching query but due to nginx misconfiguration there is always an incorrectly built query parameter.

There are more details here: https://pantheon.io/blog/update-your-nginx-config-drupal-8
In the section titled "Some Navigation Elements are Missing CSS Styling"

update_your_nginx_config_for_drupal_8___pantheon

Typo in environment variable names

Docker compose has
PHP_SITE_NAME: dev
PHP_HOST_NAME: localhost:8000
But in default.aliases.drushrc.php for wodby/drupal-php:5.6
$aliases[isset($_SERVER['PHP_SITENAME']) ? $_SERVER['PHP_SITENAME'] : 'dev'] = array(
'root' => '/var/www/html/' . (isset($_SERVER['PHP_DOCROOT']) ? $_SERVER['PHP_DOCROOT'] : ''),
'uri' => isset($_SERVER['PHP_HOSTNAME']) ? $_SERVER['PHP_HOSTNAME'] : 'localhost:8000',
);

Drupal with https

I have installed a basic Drupal set up, using the example docker-composer.yml.
For my project I need the Drupal site accessed through https, though.
How can that be managed through the Docker containers of docker4drupal?

Thank you very much for clarifying.

Speed on OS X

I've been experimenting with the Docker for Mac beta and had set up something similar with persistent database storage using the OS X file system. I haven't tried your version yet but I was wondering how you find the speed? On my set up it was unusable for Drupal development.

I've had to go back to a Parallels based VM running boot2docker and NFS for file sharing. This makes for a nice speedy set up but I can't use the local filesystem for database storage due to permissions issues.

Drush Alias is not appearing

The latest update to the drupal PHP 5.6 and 7.0 images removed the drush alias file. Please add this back into the docker image.

Serving Drupal from a subdirectory?

Hi,

I have the following folder structure:

/var
    /www
        /html
            docker-compose.yml
            /drupal-composer
                /web (Drupal docroot installed through drupal-composer)
                    index.php
            index.html

In the docker-compose.yml, I defined:

PHP_DOCROOT: drupal-composer/web
NGINX_DOCROOT: drupal-composer/web

Visiting localhost:8000 serves index.html and not index.php. I made sure to reload the containers via docker-compose restart.

Any idea what I might be missing?

Thanks!

Running multiple docker4drupal

It should be noted somewhere in documentation that if someone wishes to run two or more docker4drupal that they should just use other ports for all containers in docker-compose.yml (if I understood well. I was not familiar with docker before this and that enabled me to have more than one system running).

If you have some other suggestions how it should be done, I'd be glad to hear.

Here is my second configuration, just for reference (I used 7000 ports instead of 8000 which I used for first one):

version: "2"

services:
  mariadb:
    image: wodby/drupal-mariadb
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: 1
      MYSQL_DATABASE: drupal
      MYSQL_USER: drupal
      MYSQL_PASSWORD: drupal
    volumes:
      - ./docker-runtime/mariadb:/var/lib/mysql
#      - ./docker-runtime/mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.

  php:
    image: wodby/drupal-php:5.6 # Allowed: 7.0, 5.6.
    environment:
      PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
      PHP_XDEBUG_ENABLED: 1 # Set 1 to enable.
    volumes:
      - ./:/var/www/html

  nginx:
    image: wodby/drupal-nginx
    environment:
      NGINX_UPSTREAM_NAME: php
      NGINX_DOCROOT: drupal # Relative path inside the /var/www/html/ directory.
      DRUPAL_VERSION: 7 # Allowed: 7, 8.
    volumes_from:
      - php
    ports:
      - "7000:80"

  pma:
    image: phpmyadmin/phpmyadmin
    restart: always
    environment:
      PMA_HOST: mariadb
      PMA_USER: drupal
      PMA_PASSWORD: drupal
      PHP_UPLOAD_MAX_FILESIZE: 1G
      PHP_MAX_INPUT_VARS: 1G
    ports:
     - "7001:80"

  mailhog:
    image: mailhog/mailhog
    ports:
      - "7002:8025"

  redis:
    image: redis:3.2-alpine

#  memcached:
#    image: memcached:1.4-alpine

#  solr:
#    image: solr:5.5-alpine
#    volumes:
#      - ./docker-runtime/solr:/opt/solr/server/solr/mycores
#    ports:
#      - "8003:8983"

Additional mysql config

Need ability to change/extend default mysql settings, it could be placed as my.cnf near drupal-compose.yml and used as option in yml to extend default settings.
I just need to increase innodb_buffer_pool =)

chown: /var/lib/mysql: Operation not permitted

Got an error with mounting ./mariadb:
YML:

volumes:
- ./mariadb:/var/lib/mysql

Console:

Creating drupalcompose_db_1
Creating drupalcompose_app_1
Creating drupalcompose_web_1
Attaching to drupalcompose_db_1, drupalcompose_app_1, drupalcompose_web_1
db_1 | chown: /var/lib/mysql: Operation not permitted
app_1 | [14-Jul-2016 09:59:04] NOTICE: fpm is running, pid 1
db_1 | Cannot change ownership of the database directories to the 'mysql'
app_1 | [14-Jul-2016 09:59:04] NOTICE: ready to handle connections
db_1 | user. Check that you have the necessary permissions and try again.
drupalcompose_db_1 exited with code 1

Elasticsearch?

Any plans to introduce an Elasticsearch container? Like many, we are moving all sites over from Solr to Elasticsearch, so it would be good to have in dev environment as well.

Drupal Settings File

Not sure where this should go but this took me a long time to figure out. In the drupal settings file the db connection should be:

$databases = array (
    'default' =>
        array (
            'default' =>
                array (
                    'database' => 'drupal',
                    'username' => 'drupal',
                    'password' => 'drupal',
                    'host' => 'mariadb',
                    'port' => '3306',
                    'driver' => 'mysql',
                    'prefix' => '',
                ),
        ),
);

In most cases the host is localhost or 127.0.0.1 but docker changes it a bit...

File Permission on Windows 10 in /files

I'm using the Windows 10 Docker App, getting evertything to run except uploading files via Drupal backend. The first file ever will upload and put in to the subfolder e.g. 2016-08. Afterwards no other file can be uploaded. So i guess it's a problem with file permissions/user id, but i don't find a way to do anything about it, like the chgrp command suggested for Linux envoirement. Is there any trick to do?

Drupal Composer project : web root inside project subdir

Linux Mint 18 (Ubuntu 16), Composer version 1.2.0, Docker version 1.12.0, docker-compose version 1.8.0

Using https://github.com/drupal-composer/drupal-project (after composer install & also update + sudo docker-compose up -d) I got :

Warning: require(/var/www/html/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/autoload.php on line 16

Fatal error: require(): Failed opening required '/var/www/html/../vendor/autoload.php' (include_path='.:') in /var/www/html/autoload.php on line 16

Modifying docker-compose.yml, I replaced :

  php:
    image: wodby/drupal-php:7.0 # Allowed: 7.0, 5.6.
    environment:
      PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
      PHP_XDEBUG_ENABLED: 0 # Set 1 to enable.
    volumes:
      - ./:/var/www/html

by :

...
    volumes:
      - ./web:/var/www/html

Then :

sudo docker-compose stop
sudo docker-compose up -d

Accessing http://localhost:8000/ or http://localhost:8000/web I got File not found....

Here's the project tree :

./
├── composer.json
├── composer.lock
├── docker-compose.yml
├── docker-runtime/
│   └── mariadb/
├── drush/
│   └── ...
├── scripts/
│   └── ...
├── vendor/
│   └── ...
├── web/
│   ├── autoload.php
│   ├── core/
│   ├── index.php
│   ├── modules/
│   ├── profiles/
│   ├── robots.txt
│   ├── sites/
│   ├── themes/
│   ├── update.php
│   └── web.config
└── wodby.yml

What's the proper way to run a project which "web" root is inside a subdirectory ?

Build is fine locally, but PHP container fails to connect to MySQL container on Travis

Messages when trying to connect to mysql container from php container on Travis:

docker-compose exec --user 82 php /bin/sh -c "mysql -udrupal -pdrupal -h mariadb drupal -e 'SHOW TABLES;'"

ERROR 2003 (HY000): Can't connect to MySQL server on 'mariadb' (111 "Connection refused")

Builds for a local development environment are working fine, using the same docker-compose.yml file for both environments.

Sending emails

Great work guys.
I would like to ask about sendmail. I connected to the php container and tried to use /usr/bin/sendmail for a test email. I wanted to be sure that it works and mailhog grabs the emails.

Unfortunately I get the message

sendmail: can't connect to remote host (127.0.0.1): Connection refused

Can you help me on this issue? Did I do something wrong with it?

Thank you for your help.

Need sudo to run Docker app on Mac

I left this issue on Docker for Mac issue queue: Docker runs under root, 'docker info' cannot connect to the Docker demon #132.

I followed instructions on http://Docker4Drupal.org and everything went as expected (Mac 2011 i7, OS X 10.11, 8GB) except

$ docker info

did not produce anything but error that is can't connect to docker demon.

I was wondering why as I have clearly seen that docker processes are running under my user but still it was unable to connect.

I tried sudo docker info and it worked, also sudo docker-compose up -d also worked.

Any clue why is that happening?

$ docker -v
Docker version 1.12.0, build 8eab29e

Nice effort guys!

Hey,

Have you considered supporting almost a year old Dockerized Drupal initiative (FYI I'm the initial author of that project) as this project is also trying to make Drupal development with Docker easier. I think that we are trying to achieve the same goal here, but correct me if I'm wrong.

Docker bundle for non-drupal applications

It would be great to have something like docker4drupal but with non-drupal applications support (silex, symfony, etc) - docker4php.
Seems that drupal-mariadb and drupal-php could be named as wodby-mariadb, wodby-php to be used as common containers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.