Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

technical upgrade on Docker system #39

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [#23](https://github.com/green-code-initiative/creedengo-ios/pull/23) Docker update (updated SonarQube and sonar-apple versions)
- [#37](https://github.com/green-code-initiative/creedengo-ios/issues/37) Renaming to Creedengo
- [#39](https://github.com/green-code-initiative/creedengo-ios/pull/39) technical upgrade on docker system

### Deleted

Expand Down
19 changes: 17 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
FROM sonarqube:10.5.0-community
ARG MAVEN_BUILDER=3-openjdk-17-slim
#ARG SONARQUBE_VERSION=24.12.0.100206-community
ARG SONARQUBE_VERSION=10.5.0-community
dedece35 marked this conversation as resolved.
Show resolved Hide resolved

FROM maven:${MAVEN_BUILDER} AS builder

COPY . /usr/src/creedengo

WORKDIR /usr/src/creedengo
COPY sonar-ios-plugin/src src/
COPY pom.xml tool_build.sh ./

RUN ./tool_build.sh

FROM sonarqube:${SONARQUBE_VERSION}
USER root
ADD https://github.com/insideapp-oss/sonar-apple/releases/download/0.5.0/sonar-apple-plugin-0.5.0.jar /opt/sonarqube/extensions/plugins/sonar-apple-plugin-0.5.0.jar
RUN chmod 777 /opt/sonarqube/extensions/plugins/sonar-apple-plugin-0.5.0.jar
USER sonarqube
COPY --from=builder /usr/src/creedengo/sonar-ios-plugin/target/creedengo-*.jar /opt/sonarqube/extensions/plugins/
USER sonarqube
26 changes: 17 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
version: "3.3"
name: sonarqube_creedengo_ios

services:
sonar:
build:
dockerfile: Dockerfile
context: .
build: .
container_name: sonar_creedengo_ios
ports:
- "9000:9000"
- ":9000"
networks:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dynamic ports does not seem to work on macOS : I see not port binding when inspecting with Docker desktop

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see my comments on Slack

- sonarnet
depends_on:
- db
db:
condition: service_healthy
environment:
SONAR_JDBC_USERNAME: sonar
SONAR_JDBC_PASSWORD: sonar
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonarqube
SONAR_ES_BOOTSTRAP_CHECKS_DISABLE: 'true'
env_file:
- path: ./.default.docker.env
required: true
- path: ./.override.docker.env
required: false
volumes:
- type: bind
source: ./sonar-ios-plugin/target/creedengo-sonar-ios-plugin-2.0.0-SNAPSHOT.jar
target: /opt/sonarqube/extensions/plugins/creedengo-sonar-ios-plugin-2.0.0-SNAPSHOT.jar
- "extensions:/opt/sonarqube/extensions"
- "logs:/opt/sonarqube/logs"
- "data:/opt/sonarqube/data"
db:
Expand All @@ -34,6 +37,11 @@ services:
POSTGRES_PASSWORD: sonar
POSTGRES_DB: sonarqube
PGDATA: pg_data:/var/lib/postgresql/data/pgdata
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U sonar -d sonarqube" ]
interval: 5s
timeout: 5s
retries: 5

networks:
sonarnet:
Expand Down
Loading