Local Docker compose
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
During the analysis, no data leaves your environment, ensuring the confidentiality and security of your information.
💻 Requirements
🦊 GitLab Application
- On your GitLab instance, open the
Applicationspage:Your picture > Preferences > Applications(example: gitlab.com) - 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
- Name:
- Click on
Save Applicationand you should see the following screen:
- Keep this GitLab tab open, the
Application IDandSecretwill be used in the configuration step
📥 Setup your environment
- Clone the repository locally
git clone https://github.com/r2devops/self-managed.git r2devops
cd r2devops - Create your configuration file
cp .env.local.example .env
📚 Update the configuration
-
Edit the
.envfile:-
Copy/paste the
Application IDand theSecretfrom the GitLab application you just created.envGITLAB_OAUTH2_CLIENT_ID="<application-id>"
GITLAB_OAUTH2_CLIENT_SECRET="<application-secret>" -
Replace
<your-gitlab-url>by domain of your GitLab server.envJOBS_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 inORGANIZATIONvariable (else, let it empty).envORGANIZATION="<top-level-group-path>"
-
-
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!
- Start R2Devops
docker compose -f compose.local.yml up -d - Open your R2Devops test instance 👉 click here 🎉
⏫ Update R2Devops
Follow these steps to update your self-managed instance to a new version:
- Navigate to the location of your
self-managedgit repository - Update it
git pull - Open the
.env.local.examplefile and copy the values ofFRONTEND_IMAGE_TAGandBACKEND_IMAGE_TAGvariables - Edit the
.envfile by updating values ofFRONTEND_IMAGE_TAGandBACKEND_IMAGE_TAGvariables with the values previously copied.envFRONTEND_IMAGE_TAG="<new frontend version>"
BACKEND_IMAGE_TAG="<new backend version>" - Restart your containers
docker compose -f compose.local.yml up -d - You have successfully updated R2Devops on your server 🎉