Code Monkey home page Code Monkey logo

gitlab-docker's Introduction

Gitlab in Docker (compose)

1. Clone this repo

git clone [email protected]:rboonzaijer/gitlab-docker.git

cd gitlab-docker

2. Setup

Create the .env file, and use your OWN data

cp .env.example .env

Make each '{file}.sh' file executable

chmod +x *.sh

3. First run

docker compose up -d

Now wait until the container status is 'healty' (might take about 4 minutes on an i7)

You can keep checking the status with:

docker ps --filter "name=gitlab"

When you see (healthy) in the status column, then Gitlab is running: http://localhost:30000 user=root, pass=(see .env file)

Notice the warning "Anyone can register for an account.", you can run the post_setup now to automatically disable this (optional, this can also be done in the UI).

You will get a test-mail when it's completed (or an error if you did not change the 'test_email_to', of misconfigured your smtp settings). Note: the default user gets an email to confirm its account!

Note: if you change your .env file, run docker compose up -d to recreate the container, then wait until the container is 'healthy' again ( docker ps --filter "name=gitlab" )

./post_setup.sh

After this command: refresh the UI and the warning is gone. Also, you've got a mail if SMTP was properly configured.

Hint (optional): You can also do any manual changes directly in the gitlab-rails console with: docker exec -it gitlab gitlab-rails console

4. Backup/Restore

We want to backup the data in the volumes. These files will be created:

  • backup_gitlab_config.tar
  • backup_gitlab_logs.tar
  • backup_gitlab_data.tar
  • backup_gitlab_lfs.tar

Backup

This will shut down the container, create backups from the volumes, and then run the container again:

./volumes_backup.sh ./../my_backup_dir/

Restore

This will shut down the container, restore (overwrite!) the backup files into the volumes, and start the container again.

./volumes_restore.sh ./../my_backup_dir/

5. Update to latest gitlab

docker compose pull
docker compose up -d --remove-orphans

You might want to remove old images, show all images with docker images

To remove an old unused image:

docker rmi gitlab/gitlab-ee:15.5.3-ee.0

6. Add runners

./gitlab_runners_create.sh

./gitlab_runners_register.sh

gitlab-docker's People

Contributors

rboonzaijer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.