Hello everyone,
I'm trying to build a pipeline to deploy my angular14 app into a private server.
I'm facing this issue:
as we've built a custom angular material theme in our app we have changed some files within 'node_modules' folder.
Within the styles.css file there are references at that particular theme defined in a file within angular material folder in node_modules.
I can't run 'npm install' command in my pipeline as we lose the definition of our custom theme and we get an error in the building phase caused by the references defined in 'styles.css' file.
Is there a way to push my 'node_modules' folder within the docker container within the pipeline instead of installing the dependencies from 'package.json'?
The 'caching' solution seems to not be helpful to this particular case..
Does anyone have a solution?
Thanks in advance,
Costantino.
From Docker perspective, `node_modules` is just another folder and you can COPY it like any other file/folder.
You should note that:
Last point & personal recommendation - Coping the node_module is not stand procedure and may lead to unexpected results. Do revise your process. It might be a bit safer to first install the mode module you want to override its CSS, override the CSS files and then install the rest of the dependencies. Something like this:
npm install module
cp new_file.css node_module/module/old_file.css
npm install
Hope that helps
HI Erez,
thank you so much for your response!
I will follow your suggestion avoiding to copy all the node_modules folder.
I'm gonna try replace the files I need. I want to ask, how can I put my files in the docker container through the bitbucket pipeline? Sorry but I am a newbie using docker.
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Usually, you first clone your project which brings all your files.
Then, If you run your docker command from the root folder, all files will be included by default.
If your code base includes multiple projects, you might have to pass the correct Dockerfile and context to the docker command.
This might help: https://docs.docker.com/engine/reference/commandline/build/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.