frankenphp-drupal icon indicating copy to clipboard operation
frankenphp-drupal copied to clipboard

How to expose the source code inside the docker container to the host?

Open HuyNguyen206 opened this issue 1 year ago • 3 comments

After following the instruction, I can access the web in localhost but I can't see the source code in the host machine. I can only access it inside the PHP docker container.

So how to expose the source code inside the docker container to the host? So I can edit it in development env? image

Usually, I use the volume like this in PHP container - .:/opt/drupal, but it doesn't work in this case

HuyNguyen206 avatar Apr 19 '24 04:04 HuyNguyen206

Hi @HuyNguyen206, in the docker image the work directory is /app, maybe it would work if you switch to a volume like :

    volumes:
      - .:/app:cached

EDIT: Oh sorry you're right, I am using the base dunglas/frankenphp:1-php8.3 as upstream.

Renrhaf avatar Apr 19 '24 07:04 Renrhaf

@Renrhaf As I checked in dockerfile, the WORKDIR is /opt/drupal, not /app. Even though, it doesn't work

volumes:
      - .:/opt/drupal:cached

HuyNguyen206 avatar Apr 19 '24 08:04 HuyNguyen206

hi @dunglas , could you help me to solve this issue? Maybe I am missing some configuration related to docker but I am not sure. Thank you in advanced.

HuyNguyen206 avatar Apr 19 '24 09:04 HuyNguyen206