Answer the question
In order to leave comments, you need to log in
How to do livereload for php in Docker?
Good day.
It's no secret that the main disadvantage of docker is the inconvenience of development: every time after changing files, you have to do docker cp in order to copy the changes to the container. However, volume would seem to provide the ability to link a directory in a container to a directory on the host machine.
FROM php:7.2.19-apache
VOLUME data /var/www/html
COPY data /var/www/html
# все остальные команды
- Dockerfile
- config
- data
-- app
Answer the question
In order to leave comments, you need to log in
VOLUME is not analogous to the -v switch when starting a container or volume ./data:/var/www/html in docker-compose. It simply creates a disk storage for the container and maps it to /var/lib/docker/volumes.
To mount a local directory, you still need to use the -v switch for docker or the equivalent in docker-compose.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question