wodby / drupal-php

PHP docker container image for Drupal
https://wodby.com/stacks/drupal
MIT License
60 stars 81 forks source link

Document SSH access configuration #38

Closed Vacilando closed 5 years ago

Vacilando commented 7 years ago

Please document docker-compose.yml configuration to access the PHP container via SSH. Perhaps best would be to add it as a commented section in docker-compose.yml itself.

Something like this works for me (inspired by https://github.com/wodby/docker4drupal/issues/65#issuecomment-288293006):

  sshd:
    image: wodby/drupal-php:7.1-2.1.0
    command: /usr/sbin/sshd -De
    environment:
      SSH_PUBLIC_KEYS: |-
        ["MYKEY"]
    volumes:
      - ./:/var/www/html
    ports:
      - '2222:22'
Vacilando commented 7 years ago

Drush did not work when using drupal-php versions with stability tags -- see #39

Here's an updated snippet that works -- could you please adjust the documentation and the default docker-compose.yml as needed?

  sshd:
    image: wodby/drupal-php:7.1-2.4.3
    command: /usr/sbin/sshd -De
    environment:
      SSH_PUBLIC_KEYS: |-
        ["PUBLICKEY"]
    volumes:
      - ./:/var/www/html
      - PRIVATEKEY_PATH:/home/www-data/.ssh/id_rsa
    ports:
      - '2222:22'
csandanov commented 5 years ago

Documented at https://github.com/wodby/php#sshd