DEV Community

Dendi Handian
Dendi Handian

Posted on • Updated on

Gitlab in Laradock

It's been a while since the last time I used Laradock, because my current projects development still quite simple that it's only need Laragon. There is a one thing that I want to try in Laradock that still made me curious. It's simulating CI/CD in Laradock environment using Gitlab, Jenkins, and Sonarqube, or maybe even more. I know this is possible to try, so I started by using the Gitlab first here.

Running Gitlab Service in Laradock

As usual, open your console and go to laradock directory. The command is:

docker-compose up -d gitlab
Enter fullscreen mode Exit fullscreen mode

The Gitlab service takes 2.6GB memory usage approximately (See the docker stats below). So make sure you have enough memory allocation space for this or the service will not up and running.

The gitlab service depends on postgres and redis, so don't freak out if these images is being pulled before gitlab.

When all image pulled and container created as well, checking it using docker-compose ps should have return good result like this:

       Name                      Command                  State                                     Ports
---------------------------------------------------------------------------------------------------------------------------------------
laradock_gitlab_1     /assets/wrapper                  Up (healthy)   0.0.0.0:2289->22/tcp, 0.0.0.0:9898->443/tcp, 0.0.0.0:8989->80/tcp
laradock_postgres_1   docker-entrypoint.sh postgres    Up             0.0.0.0:5432->5432/tcp
laradock_redis_1      docker-entrypoint.sh redis ...   Up             0.0.0.0:6379->6379/tcp
Enter fullscreen mode Exit fullscreen mode

Also when we check it using docker stats, we could see that gitlab service takes huge memory usage:

CONTAINER ID   NAME                  CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O   PIDS
76576e8b87d5   laradock_gitlab_1     4.12%     2.603GiB / 6.043GiB   43.07%    6.78MB / 84.3MB   0B / 0B     314 
8bb28fc3473f   laradock_redis_1      1.68%     11.93MiB / 6.043GiB   0.19%     82MB / 3.36MB     0B / 0B     5   
0af95b272813   laradock_postgres_1   0.39%     86.07MiB / 6.043GiB   1.39%     2.35MB / 3.42MB   0B / 0B     16
Enter fullscreen mode Exit fullscreen mode

Accessing the Gitlab web

Open your browser and go to http://localhost:8989, you should see a gitlab login page:

Alt Text

You can start to register as a user at http://localhost:8989/users/sign_up. After submit the register form, the account will be in pending status and the root admin need to approve the user.

Login as Gitlab Admin

The default username is root and the password is laradock. Try to login as the admin in the main login page. After successfully logged, you can approve the previous pending status user at http://localhost:8989/admin/users.

Pushing a project to the Gitlab

In progress


Top comments (0)