I want to run a GitLab Runner alongside the containers that will automatically apply changes made to the code on the GitLab server to the website. I found the following articles:
But none of them have explained how Nginx and Node.js containers can access the code that is in the GitLab server!
Do containers need to be run on the GitLab server?
I would be grateful if someone could guide me in this example.
A GitLab runner deploys Software to a system where it actually runs. A Gitlab runner is not where you run your software.
So you can run it on AWS, GCP, Azure, etc.
The regular procedure is that when code is to pushed to gitlab, the gitlab runner gets a signal, builds the new software and then pushes it to wherever it runs. During the build a docker container is build that contains the code from the Github repository.
So the system doesn’t need to pull anything from Gitlab, the Gitlab runner will create a docker container and push that to the system.
Hello,
Thank you so much for your reply.
For example, the codes are in Node.js form and these codes should be executed by Nginx and Node.js containers. Are these containers built by GitLab Runner? No containers are created on the GitLab server?
Can you recommend a setup tutorial for beginners?
Before we start with any of the building and hosting steps, can you please explain a bit about your application?
How are you running the application locally?
Can you please show the Dockerfile(s) you are using for your application?
Does your application need some kind of file storage or a database?
How familiar are you with different hosting companies? Eg AWS, GCP, Azure, etc
How familiar are you with deploying applications? Eg have you ever deployed something to a VM, or Docker container? Do you know tools like Terraform, Ansible, Capistrano, etc?
Installing a nodejs application with microservices in a docker and use GitLab with GitRunner as Auto-Deploy-Environment (Continuos Integration) is kings class and nothing you can do with a simple tutorial.
Hi,
Thanks again.
1- As I said, I have two servers. One is the GitLab server and the other is for containers and GitLab Runner.
2- The Dockerfile(s) are:
FROM nginx:latest
WORKDIR /usr/share/nginx/html
COPY ./default.conf /etc/nginx/conf.d/default.conf
COPY ../www/ /usr/share/nginx/html
And:
FROM node:latest
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY ./www/package.json /usr/src/app/package.json
RUN npm install
RUN npm update
COPY ./www /usr/src/app
And:
FROM redis:latest
COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
3- Yes. Applications use MongoDB.
4- I’m not familiar with them.
5- Yes. I know something about Docker and virtualization.