Hi @quartje ! This PR adds the possibility to mount local directories with code into one of the services that the user chooses.
It uses:
docker-compose.yml files that override settings for just the service in question. Each service directory has one of these files. They mount a local volume over /var/html/www in the container
the local directory to mount is chosen from an environment variable because docker compose files have the ability to read env vars and replace them in the file, like a templating system
a startup script called start-dev-env.sh that takes two parameters: the service name and the local directory to mount. Example: start-dev-env.sh webauthn /home/dan/Stepup-webauthn (the recommended way would be to use absolute paths).
the startup script uses these two parameters to read the docker compose override file from the service's directory and replace the code path in that file (by reading it as an env var)
NOTES:
if you do not like the idea of a startup script (it is a really simple one), we can just instruct the devs on how to run this manually:
export CODE_PATH=<path_to_code>docker-compose -f docker-compose.yml -f <service_directory>/docker-compose.override.yml up
I also had another idea where we can have a single docker-compose.override.yml file in the root directory that we can use as a template. And use some sed / bash magic to replace what we need in that file for any service required. But I think it is more prone to errors and also having an override file for each service allows us in the future to do more dev customisation for each service.
Hi @quartje ! This PR adds the possibility to mount local directories with code into one of the services that the user chooses.
It uses:
docker-compose.yml
files that override settings for just the service in question. Each service directory has one of these files. They mount a local volume over/var/html/www
in the containerstart-dev-env.sh
that takes two parameters: the service name and the local directory to mount. Example:start-dev-env.sh webauthn /home/dan/Stepup-webauthn
(the recommended way would be to use absolute paths).NOTES:
if you do not like the idea of a startup script (it is a really simple one), we can just instruct the devs on how to run this manually:
export CODE_PATH=<path_to_code>
docker-compose -f docker-compose.yml -f <service_directory>/docker-compose.override.yml up
I also had another idea where we can have a single docker-compose.override.yml file in the root directory that we can use as a template. And use some sed / bash magic to replace what we need in that file for any service required. But I think it is more prone to errors and also having an override file for each service allows us in the future to do more dev customisation for each service.