GitLab Runner and Microservice

Hello,
A website is built with Node.js and uses several microservices. The codes of this website are located in a GitLab server. Is a GitLab Runner required for each microservice?

Thank you.

No, you could use one GitLab runner for testing all the microservices. Do note you can only run one job at a time on a runner, so if you need to run a lot of tests concurrently it might be beneficial to spin up more GitLab runners.

1 Like

It is not necessary to use a separate GitLab Runner for each microservice. You can configure one or more GitLab Runners to handle builds for all microservices. Depending on the size and complexity of your builds, as well as the resources available, you can decide how many Runners you need to run your CI/CD process efficiently.

Haha, sorry CI/CO and efficiency in one sentence is a perfect paradoxim.

To run microservices from code stored on a GitLab server, GitLab Runner is required if you want to automate the process of deploying and testing each microservice. Runner will pull code from the GitLab repository and perform the actions you specify, such as building, testing, and deploying. However, if you prefer to run microservices manually without automation, GitLab Runner is not required for every microservice.

1 Like

Hello,
Thank you so much for your reply.
Please consider the following picture:

These are parts of a website written in Node.js. Each of them has its own package.json file. A normal website usually has an index.html file that the web server sees and the entire website is loaded. I have some questions:

1- Don’t microservices have something called index.html?

2- Should a container be created for each of these projects?

No, a GitLab Runner is not necessarily required for each microservice in a Node.js website using microservices architecture. Depending on your project’s needs and complexity, you can configure GitLab Runners to handle CI/CD pipelines for multiple microservices or set up separate Runners for each if necessary.

1 Like

Not necessarily, no. They might, but they don’t have to.

You tell us. How are these git repositories related to one another?

1 Like

Hello,
Thank you so much for your reply.
In a microservice example, I saw that in the directory of each project there is a Dockerfile with the same contents as below:

FROM node:11.2.0-alpine

WORKDIR /usr/app

ADD . /server

RUN cd /server; \
    npm install

EXPOSE 3000

CMD ["node", "/server/src/server.js"]

Since the Dockerfile(s) are the same, wouldn’t that break the original docker image or any conflict?

Why would it?

1 Like