Skip to content

How to use docker drush with docker-compose  #32

Description

@JulienD

Hi

This is a more a documentation issue than anything else.

I've downloaded the image and run drush as a standalone container like described on the Readme page and it worked well. In order to go deeper, I want to understand how to link a drush container with others containers but unfortunately I have not been able to make it working.

In my docker-compose.yml file I have defined the following containers:

nginx:
  build: nginx-fpm
  links:
    - phpfpm
  ports:
    - "8080:80"
  volumes_from:
    - data

phpfpm:
  build: php-5.6-fpm-custom
  volumes_from:
    - data
    - db

db:
  image: mariadb
  volumes:
    - /var/run/mysqld
    - ./databases/active:/var/lib/mysql
  environment:
    MYSQL_ROOT_PASSWORD: password
    MYSQL_DATABASE: application

data:
  image: busybox
  stdin_open: true
  volumes:
    - ./htdocs:/var/www/html

drush:
  image: drush/drush
  volumes_from:
    - data
    - db
  links:
    - phpfpm
    - db

When starting all the containers, I can see Drush's container working, displaying the list of commands and them exiting.

....
drush_1   |  (wd-list)            prompt will ask for a choice to show watchdog messages.
drush_1   |  watchdog-show        Show watchdog messages.
drush_1   |  (wd-show, ws)
dockerlemp_drush_1 exited with code 0

I though the container would live as a normal container and would allow me to manage Drupal.

Maybe I did not understand the purpose of this repo or maybe this is due to my short experience with docker and docker-compose but I have not found how to use the repo with several containers. Could you give me a hint on how to achieve it ?

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions