Skip to main content

Local Docker compose

Only for testing purposes on your local computer

This page describes how to quickly setup a self-managed instance of R2Devops for testing purposes using Docker-compose on your local computer. This is not suitable for production

See production ready methods on Home page

Data Confidentiality

During the analysis, no data leaves your environment, ensuring the confidentiality and security of your information.

💻 Requirements

🦊 GitLab Application

  1. On your GitLab instance, open the Applications page: Your picture > Preferences > Applications (example: gitlab.com)
  2. Create an application with the following information :
    • Name: R2Devops self-managed
    • Redirect URI : http://localhost:3001/api/auth/gitlab/callback
    • Confidential: true (let the box checked)
    • Scopes: api
  3. Click on Save Application and you should see the following screen: Application
  4. Keep this GitLab tab open, the Application ID and Secret will be used in the configuration step

📥 Setup your environment

  1. Clone the repository locally
    git clone https://github.com/r2devops/self-managed.git r2devops
    cd r2devops
  2. Create your configuration file
    cp .env.local.example .env

📚 Update the configuration

  1. Edit the .env file:

    • Copy/paste the Application ID and the Secret from the GitLab application you just created

      .env
      GITLAB_OAUTH2_CLIENT_ID="<application-id>"
      GITLAB_OAUTH2_CLIENT_SECRET="<application-secret>"
    • Replace <your-gitlab-url> by domain of your GitLab server

      .env
      JOBS_GITLAB_URL="https://<your-gitlab-url>"
    • Only if you use a SaaS version of GitLab (like gitlab.com): add the name of your top-level group in ORGANIZATION variable (else, let it empty)

      .env
      ORGANIZATION="<top-level-group-path>"
  2. Run the following commands to generate random secrets for all components:

    sed -i."" "s/REPLACE_ME_BY_SECRET_KEY/$(openssl rand -hex 32)/g" .env
    sed -i."" "s/REPLACE_ME_BY_JOBS_DB_PASSWORD/$(openssl rand -hex 16)/g" .env
    sed -i."" "s/REPLACE_ME_BY_JOBS_REDIS_PASSWORD/$(openssl rand -hex 16)/g" .env

🚀 Launch R2Devops!

  1. Start R2Devops
    docker compose -f compose.local.yml up -d
  2. Open your R2Devops test instance 👉 click here 🎉

⏫ Update R2Devops

Follow these steps to update your self-managed instance to a new version:

  1. Navigate to the location of your self-managed git repository
  2. Update it
    git pull
  3. Open the .env.local.example file and copy the values of FRONTEND_IMAGE_TAG and BACKEND_IMAGE_TAG variables
  4. Edit the .env file by updating values of FRONTEND_IMAGE_TAG and BACKEND_IMAGE_TAG variables with the values previously copied
    .env
    FRONTEND_IMAGE_TAG="<new frontend version>"
    BACKEND_IMAGE_TAG="<new backend version>"
  5. Restart your containers
    docker compose -f compose.local.yml up -d
  6. You have successfully updated R2Devops on your server 🎉