Answer the question
In order to leave comments, you need to log in
How to properly disable directory sync in Docker?
I have a Symfony project hosted in a docker container
...
php:
build:
context: ./docker/php
ports:
- 9000:9000
volumes:
- ./:/srv/www/project
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
- ./docker/php/php.ini:/usr/local/etc/php/php.ini
environment:
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
...
Answer the question
In order to leave comments, you need to log in
I don't know for sure, but perhaps in Symfony you can somehow change the location of the var folder. Then you can take it out of volume and it will be inside the container. Although there are logs ... logs are convenient to have outside.
Adjusting volume so that part of it is... not volume.. is somehow unnatural. I think it's impossible.
And generally speaking. If this is a prod, then you need to rebuild the image with each release so that only data sticks out, and the code is part of the image.
If it's dev, then what's the problem? Let yourself slow down. By the way, if this is dev and you are working under windows and docker is running in a virtual machine, then the reason for the brakes may not be in the volume, but in the shared folder of the virtual machine.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question