Closed webflo closed 7 years ago
Hi Florian, sorry for late response but I just got back home from DDD.
Generally /html/var/www
is suggested directory for your project. By default that's also docroot for nginx and apache images we provide, to simplify setup for small projects. You can of course change it to something else (i.e. /app
) but that change involves overriding all images we provide and adding your custom volume (i.e. VOLUME /app
in your Dockerfile).
Volume definitions are important in multi-container environments as almost all containers must have access to shared code, including php, nginx, drush or drupal console. That's why symlinks won't work: source folder - /app
- is not shared across containers, only symlink itself - /var/www/html
.
For now I would recommend to mount your code in /var/www/html
and change default nginx/apache docroot to /var/www/html/www
like here https://github.com/nymedia/docker/tree/master/nginx/stable or just mount custom drupal.conf
to nginx/apache container.
I have solution in mind to simplify docroot modifications using environment variable, but that's for nginx/apache images. I will let you know when option will be available. Same with php:apache (mod_php).
Wodby/drupal-nginx does it during container startup. https://github.com/Wodby/drupal-nginx/blob/6972c1b13ba67e05a6a994f0ebbe021a04592531/docker-entrypoint.sh#L18
Works great.
@webflo Based on that approach I created https://github.com/drupal-docker/nginx/pull/13.
Coming from drupal-composer/drupal-project ...
How can i use the php docker image with it? I tried to mount my code in
/app
and replace/var/www/html
with a symlink to/app/web
on container startup. It did not work. Do you have a solution in mind already? Or is it out of scope and i should build my custom container?