Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shargr1's avatar

How to make a volume in a docker container to reflect laravel changes in real-time

I'm currently working on a docker dev env running ember on the frontend and laravel on the backend. I have the code volumed in, but any changes made to the code are not reflected until I rebuild the container using "docker-compose up --build."

I've tried pointing the volume to a few different paths and haven't been able to get the code to update in real time. Is there a widely accepted path in a laravel application to point the volume to in order to reflect changes in real-time?

volume strings I've tried for the container in docker-compose.yml: ./backend/src/storage/app:/app

./backend/src/storage:/app

./backend/src/app:/app

Clearing caches hasn't reflected changes, a docker-compose up without the --build flag hasn't worked either.

0 likes
2 replies
bulutfon's avatar

It should ./backend/src:/app I assume /app is working app inside docker. If you don't correctly map volume, code sync won't work.

1 like
shargr1's avatar

Yeah I figured I had the volume path wrong. .backent.src:/app didn't work either. /app is the working app inside the container.

Please or to participate in this conversation.