I'm still dockerizing our microfrontend application. Currently we use React and Angular and a shared library for the communication. The library is developed by ourself and installed locally via npm.
'- angular-project
'- react-projects
'- shared-libs
'- communication-lib
We are installing the communication-lib locally with
npm install ..\shared-libs\communication-lib
Running everything locally works fine. But as we move to docker, there are several issues and I can't figure out a good solution. Below are the first few lines of the angular projects Dockerfile
FROM node:16-alpine As development
WORKDIR /usr/src/app/frontend
COPY ./angular/package.json ./angular/package-lock.json ./
RUN npm i
...
# already crashed here
This is the point where docker fails because the lib is not known to the docker image. I also added a volume to share the code of the shared lib with this image, but then i still have the issue of not having a already build node_module.
I'm really thankful if someone could provide me some useful hints how to solve this issue.
My thougths:
Is it somehow possible to create a standalone docker for the libs and use these container in my angular projects container?
Can I somehow copy/build and link the lib inside the container ?