I am building a dockerfile from a SPA using very basic js and html
I want to copy only some files to the docker image, but I am really struggling to do so as following: docker file commands
I have also tried several variations, i.e removing ./ from the index html, also doing it on one line using "array" style... But all these tries end up in writing the index.html content to all files, for example I will see the index html content inside the style.css,seeing it from the dev Tools on chrome. Therefore the page won't work as expected
The only workaround I have managed to get working is making a script using copy and placing everything on a "dist" folder, then copying everything on the folder to the docker image. That way it would work, but I'd prefer not to use a script and instead copy everything needed from the dockerfile straight away.
Any help is appreciated
Okay, after more than 5h trying workarounds, I found out the question myself. Problem was not understanding COPY command, I was copying files to the root, instead of placing them on the correct folder: Correct Dockerfile
Notice the folder where every file is copied to