Allow user of an Angular app to override configuration files in its assets folder

Hello,

i have written an angular app with an assets folder that contains configuration files. Now I want to pack the whole application into a docker container. I want that during the docker build the asset folder is copied from the container to the host os and shared as a volume such that a person can change the configuration files on the host os without accessing the docker container.
How can I achieve that?

Thanks in advance.

Best regards,
asker012

During build: you can’t. A build just creates an image, but is not about running that image as a container.

But before starting the container, the user can bind any path in the container to a local folder, which then replaces (hides) the original folder from the container. See Use bind mounts | Docker Documentation.

Note that Docker will not copy the files from the image into such bind mount. (It will do that for empty volumes, but not for empty bind mounts which is what your user needs.) So, the user needs to specify all files from the folder that is hidden/replaced by using the bind mount. Or the application should be changed to copy the files on start up, like for example the WordPress image does.