You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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,
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
Hope that helps
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
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/