So far, I have used the local LAMP stack to develop my web projects and deploy them manually on the server. For the next project, I want to use docker and docker-compose to create mariaDB, NGINX and the project container for easy development and deployment.
In development, I want my code directory on the host machine to be synchronized with the docker container. I know this can be achieved at startup
docker run -dt --name containerName -v /path/on/host:/path/in/container
in cli, as indicated here , but I want to do this in the file of the vock-compose file.
As long as the docker-composer.yml file looks like this:
version: '2'
services:
db:
myProj:
build: ./myProj
image: myProj
depends_on:
- db
volumes:
myCodeVolume:/var/www
volumes:
myCodeVolume:
How can I synchronize the / var / www directory in the container with my host machine (Ubuntu, MacOS or Windows desktop)?
.