Skip to content

Commit

Permalink
SONAR-23412 enable dual stack in docker compose example
Browse files Browse the repository at this point in the history
  • Loading branch information
jCOTINEAU authored Oct 17, 2024
1 parent f87c64c commit 848be1f
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 12 deletions.
29 changes: 18 additions & 11 deletions example-compose-files/sq-dce-postgres/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
db:
condition: service_healthy
networks:
- sonar-network
- ${NETWORK_TYPE:-ipv4}
cpus: 0.5
mem_limit: 4096M
mem_reservation: 4096M
Expand Down Expand Up @@ -51,7 +51,7 @@ services:
db:
condition: service_healthy
networks:
- sonar-network
- ${NETWORK_TYPE:-ipv4}
environment:
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
SONAR_JDBC_USERNAME: sonar
Expand Down Expand Up @@ -80,7 +80,7 @@ services:
db:
condition: service_healthy
networks:
- sonar-network
- ${NETWORK_TYPE:-ipv4}
environment:
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
SONAR_JDBC_USERNAME: sonar
Expand Down Expand Up @@ -109,7 +109,7 @@ services:
db:
condition: service_healthy
networks:
- sonar-network
- ${NETWORK_TYPE:-ipv4}
environment:
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
SONAR_JDBC_USERNAME: sonar
Expand All @@ -135,7 +135,7 @@ services:
timeout: 5s
retries: 5
networks:
- sonar-network
- ${NETWORK_TYPE:-ipv4}
environment:
POSTGRES_USER: sonar
POSTGRES_PASSWORD: sonar
Expand All @@ -150,17 +150,24 @@ services:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./unrestricted_client_body_size.conf:/etc/nginx/conf.d/unrestricted_client_body_size.conf:ro
networks:
- sonar-network
- ${NETWORK_TYPE:-ipv4}
- sonar-public

networks:
sonar-network:
ipam:
driver: default
config:
- subnet: 172.28.2.0/24
sonar-public:
driver: bridge
ipv4:
driver: bridge
enable_ipv6: false
dual:
driver: bridge
enable_ipv6: true
ipam:
config:
- subnet: "192.168.3.0/24"
gateway: "192.168.3.1"
- subnet: "2001:db8:3::/64"
gateway: "2001:db8:3::1"

volumes:
sonarqube_extensions:
Expand Down
18 changes: 17 additions & 1 deletion example-compose-files/sq-with-h2/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,24 @@ services:
- sonarqube_temp:/opt/sonarqube/temp
ports:
- "9000:9000"
networks:
- ${NETWORK_TYPE:-ipv4}
volumes:
sonarqube_data:
sonarqube_extensions:
sonarqube_logs:
sonarqube_temp:
sonarqube_temp:

networks:
ipv4:
driver: bridge
enable_ipv6: false
dual:
driver: bridge
enable_ipv6: true
ipam:
config:
- subnet: "192.168.1.0/24"
gateway: "192.168.1.1"
- subnet: "2001:db8:1::/64"
gateway: "2001:db8:1::1"
18 changes: 18 additions & 0 deletions example-compose-files/sq-with-postgres/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ services:
- sonarqube_temp:/opt/sonarqube/temp
ports:
- "9000:9000"
networks:
- ${NETWORK_TYPE:-ipv4}
db:
image: postgres:15
healthcheck:
Expand All @@ -34,6 +36,8 @@ services:
volumes:
- postgresql:/var/lib/postgresql
- postgresql_data:/var/lib/postgresql/data
networks:
- ${NETWORK_TYPE:-ipv4}

volumes:
sonarqube_data:
Expand All @@ -42,3 +46,17 @@ volumes:
sonarqube_logs:
postgresql:
postgresql_data:

networks:
ipv4:
driver: bridge
enable_ipv6: false
dual:
driver: bridge
enable_ipv6: true
ipam:
config:
- subnet: "192.168.2.0/24"
gateway: "192.168.2.1"
- subnet: "2001:db8:2::/64"
gateway: "2001:db8:2::1"

0 comments on commit 848be1f

Please sign in to comment.