55 lines
1.6 KiB
Django/Jinja
55 lines
1.6 KiB
Django/Jinja
version: '3.9'
|
|
|
|
services:
|
|
app:
|
|
image: sonarqube:{{sonarqube_version}}
|
|
depends_on:
|
|
- db
|
|
- plugin-preparation
|
|
environment:
|
|
- USER_UID={{ service_user_id }}
|
|
- USER_GID={{ service_group_id }}
|
|
- SONAR_JDBC_URL=${DB_URL}
|
|
- SONAR_JDBC_USERNAME=${DB_USER}
|
|
- SONAR_JDBC_PASSWORD=${DB_PASSWORD}
|
|
restart: always
|
|
volumes:
|
|
- {{ service_directory }}/data/appdata/data:/opt/sonarqube/data
|
|
- {{ service_directory }}/data/appdata/extensions:/opt/sonarqube/extensions
|
|
- {{ service_directory }}/data/appdata/logs:/opt/sonarqube/logs
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
ports:
|
|
- '127.0.0.1:9000:9000'
|
|
networks:
|
|
- default
|
|
|
|
db:
|
|
image: postgres:14
|
|
restart: always
|
|
environment:
|
|
- POSTGRES_USER=${DB_USER}
|
|
- POSTGRES_PASSWORD=${DB_PASSWORD}
|
|
- POSTGRES_DB=${DB_NAME}
|
|
networks:
|
|
- default
|
|
volumes:
|
|
- {{ service_directory }}/data/db:/var/lib/postgresql/data
|
|
|
|
plugin-preparation:
|
|
image: curlimages/curl:latest
|
|
init: true
|
|
environment:
|
|
- USER_UID={{ service_user_id }}
|
|
- USER_GID={{ service_group_id }}
|
|
command: ["curl", "-L", "-O", "-u {{ service_user_id }}:{{ service_group_id }}","--output-dir", "/plugins", "https://github.com/vaulttec/sonar-auth-oidc/releases/download/v2.1.1/sonar-auth-oidc-plugin-2.1.1.jar"]
|
|
volumes:
|
|
- {{ service_directory }}/data/appdata/extensions/plugins:/plugins
|
|
|
|
networks:
|
|
default:
|
|
ipam:
|
|
driver: default
|
|
config:
|
|
- subnet: 172.3.0.0/16
|
|
gateway: 172.3.0.1 |