Last active
December 7, 2024 03:37
-
Star
(113)
You must be signed in to star a gist -
Fork
(65)
You must be signed in to fork a gist
-
-
Save Warchant/0d0f0104fe7adf3b310937d2db67b512 to your computer and use it in GitHub Desktop.
docker-compose file to setup production-ready sonarqube
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
sonarqube: | |
image: sonarqube | |
expose: | |
- 9000 | |
ports: | |
- "127.0.0.1:9000:9000" | |
networks: | |
- sonarnet | |
environment: | |
- sonar.jdbc.url=jdbc:postgresql://db:5432/sonar | |
- sonar.jdbc.username=sonar | |
- sonar.jdbc.password=sonar | |
volumes: | |
- sonarqube_conf:/opt/sonarqube/conf | |
- sonarqube_data:/opt/sonarqube/data | |
- sonarqube_extensions:/opt/sonarqube/extensions | |
- sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins | |
db: | |
image: postgres | |
networks: | |
- sonarnet | |
environment: | |
- POSTGRES_USER=sonar | |
- POSTGRES_PASSWORD=sonar | |
volumes: | |
- postgresql:/var/lib/postgresql | |
- postgresql_data:/var/lib/postgresql/data | |
networks: | |
sonarnet: | |
volumes: | |
sonarqube_conf: | |
sonarqube_data: | |
sonarqube_extensions: | |
sonarqube_bundled-plugins: | |
postgresql: | |
postgresql_data: |
aawoyemi142
commented
Jan 10, 2023
via email
I edited the image with the version I wanted, saved the docker-compose file
and then ran *sudo docker-compose up -d *and it update the version to the
newly changed version.
…On Tue, Dec 6, 2022 at 7:01 AM itsecforu ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
how to correct update tag of sonarqube image version ?
I edited compose.yml and started docker stack up -c docker-compose.yml
sonarqube, but not works
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/0d0f0104fe7adf3b310937d2db67b512#gistcomment-4393281>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASNE2MJWD3JFOS27EQOXBFLWL4TI7BFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVA3TOMBWGQ2DSM5HORZGSZ3HMVZKMY3SMVQXIZI>
.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
how to set the init admin username and password ?
For what exactly? Gitlab?
…On Fri, May 5, 2023 at 10:22 AM kozla13 ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
how to set the init admin username and password ?
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/Warchant/0d0f0104fe7adf3b310937d2db67b512#gistcomment-4559114>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASNE2MKNOI2QGNWCZ35APG3XEUEMBBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVA3TOMBWGQ2DSM5HORZGSZ3HMVZKMY3SMVQXIZI>
.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
i want just to automate some stuff for local development
"Production ready" includes running postgres database. You can install
postgres and sonarqube together in a single container. I would not
recommend doing so.
…$ docker ps -q | xargs docker stats --no-stream
$ k8s_database_harbor-harbor-database-0_harbor_62dc87ee-0df7-4359-9425-bf135bcc79a3_0
910.31% ```
Just my 2 cents:
-
The "official"
docker-compose.yml
usage example for Sonarqube with PostgreSQL can be found here. -
I was able to start SonarQube v10 + PostgreSQL v15.3 on a Windows 11 machine with the following
docker-compose.yml
file. -
Edit: The alternative for
SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true
seems to be the following:-
Create (or edit) the file
%USERPROFILE%\.wslconfig
. -
Add the following:
[wsl2] kernelCommandLine="sysctl.vm.max_map_count=262144"
-
docker-compose.yml
:
version: "3"
services:
sonarqube:
image: sonarqube:10.0.0-community
hostname: sonarqube
container_name: local-sonarqube
depends_on:
- db
environment:
- SONAR_JDBC_URL=jdbc:postgresql://db:5432/sonar
- SONAR_JDBC_USERNAME=sonar
- SONAR_JDBC_PASSWORD=sonar
# The following (commented out) setting is a workaround for the following error:
#
# max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
#
# It is better to add the following to the file `%USERPROFILE%\.wslconfig` on Windows instead:
#
# [wsl2]
# kernelCommandLine="sysctl.vm.max_map_count=262144"
#- SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true
volumes:
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_logs:/opt/sonarqube/logs
ports:
- "9000:9000"
db:
image: postgres:15.3
hostname: postgres
container_name: local-postgres-for-sonarqube
environment:
- POSTGRES_USER=sonar
- POSTGRES_PASSWORD=sonar
- POSTGRES_DB=sonar
volumes:
- postgresql:/var/lib/postgresql
- postgresql_data:/var/lib/postgresql/data
volumes:
sonarqube_data:
sonarqube_extensions:
sonarqube_logs:
postgresql:
postgresql_data:
Thank you @Warchant . It works for me 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment