Skip to content

Commit d9f69f4

Browse files
🐛 Fix Docker configuration + add doc + remove gitpod configuration (#33)
1 parent 08fa7ff commit d9f69f4

16 files changed

Lines changed: 158 additions & 250 deletions

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
!target/*-runner.jar
44
!target/lib/*
55
!target/quarkus-app/*
6+
!.gcloud-conf.json

.gitpod.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.gitpod/Dockerfile

Lines changed: 0 additions & 20 deletions
This file was deleted.

.idx/dev.nix

Lines changed: 0 additions & 53 deletions
This file was deleted.

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM eclipse-temurin:25-jre
2+
3+
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
4+
5+
# We make four distinct layers so if there are application changes the library layers can be re-used
6+
COPY target/quarkus-app/lib/ /deployments/lib/
7+
COPY target/quarkus-app/*.jar /deployments/
8+
COPY target/quarkus-app/app/ /deployments/app/
9+
COPY target/quarkus-app/quarkus/ /deployments/quarkus/
10+
11+
EXPOSE 8080 8888
12+
ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
13+
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
14+
ENTRYPOINT [ "/bin/sh", "-c", "java $JAVA_OPTS -jar $JAVA_APP_JAR" ]

README.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Opensource-statistiques 📊
22

33
![GitHub Release](https://img.shields.io/github/v/release/zenika-open-source/opensource-statistics)
4-
![Quarkus](https://img.shields.io/badge/Quarkus-3.12.1-4695EB?logo=quarkus)
5-
![Java](https://img.shields.io/badge/Java-17-ED8B00?logo=openjdk&logoColor=white)
4+
![Quarkus](https://img.shields.io/badge/Quarkus-3.31.2-4695EB?logo=quarkus)
5+
![Java](https://img.shields.io/badge/Java-25-ED8B00?logo=openjdk&logoColor=white)
6+
![Javelit](https://img.shields.io/badge/Javelit-0.86.0-70FF9A)
67

78
🚧 This project is in progress ...
89

@@ -16,7 +17,8 @@ Data could be used to find and list projects maintained or forked by Zenika Memb
1617
Using:
1718
- [Quarkus](https://quarkus.io/)
1819
- [Firestore](https://docs.quarkiverse.io/quarkus-google-cloud-services/) to save data
19-
- [GitHub actions](https://github.com/features/actions) as CICD - 🚧 not implemented
20+
- [GitHub actions](https://github.com/features/actions) as CICD - to be implemented
21+
- [Javelit](https://javelit.io) to display information
2022

2123
## 🌐 API
2224

@@ -27,16 +29,46 @@ Some resources are available but only the first is in progress :
2729
- `/contributions/` to get information about contributions from GCP database 🚧 not implemented
2830
- `/workflow/` to get data and save them on GCP database
2931

32+
## 🎨 UI
33+
34+
An interface made with Javelit is available.
35+
- `http://localhost:8888` to access the Javelit dashboard
36+
37+
![zenika-open-source-dashboard](./docs/images/zenika-open-source-dashboard.png)
38+
39+
3040
> 🎯 The last resource will be removed after implementing all features and will be replaced by schedules.
3141
3242
## 📝 Setup
3343

3444
- You need a GitHub token you can generate on [this page](https://github.com/settings/tokens).
3545
- Create a `.env` file based on the `.env-example` file and set the token previously created.
36-
- You have to create a `.gcloud-conf.json` to save service account (it's not the best option actually, this can be replaced by another configuration).
37-
- Run the application with `quarkus dev` if you have the [Quarkus CLI](https://quarkus.io/guides/cli-tooling) installed on your environment, or `mvn quarkus:dev`command.
46+
- Create a `.gcloud-conf.json` file in the root of the project containing your Google Cloud service account key. This is required for the application to authenticate with GCP services.
47+
- **Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable** to point to your key file. This is crucial for authentication in your local environment.
48+
```bash
49+
export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/.gcloud-conf.json
50+
```
51+
- Run the application with `quarkus dev` if you have the Quarkus CLI installed on your environment, or `mvn quarkus:dev` command.
3852
- You can use Quarkus dev service for Firestore enabling this variable `quarkus.google.cloud.firestore.devservice.enabled` in application.properties file.
3953

54+
## 🐳 Docker
55+
56+
Start by building the image:
57+
58+
```bash
59+
docker build -t zoss-dashboard .
60+
```
61+
62+
Then run the container mapping the ports (8080 for API, 8888 for UI) and mounting the credentials:
63+
64+
```bash
65+
docker run -it --rm \
66+
-p 8080:8080 -p 8888:8888 \
67+
-v "$(pwd)/.gcloud-conf.json:/etc/gcp/creds.json:ro" \
68+
-e GOOGLE_APPLICATION_CREDENTIALS=/etc/gcp/creds.json \
69+
zoss-dashboard
70+
```
71+
4072
## ✨Contribute
4173

4274
Anyone can contribute to this project. For the moment, please add your question or propose something in [a new issue](https://github.com/zenika-open-source/opensource-statistics/issues).
145 KB
Loading

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<quarkus.platform.version>3.31.2</quarkus.platform.version>
1616
<surefire-plugin.version>3.2.5</surefire-plugin.version>
1717
<quarkus.google-cloud-services.version>2.20.1</quarkus.google-cloud-services.version>
18+
<javelit-version>0.86.0</javelit-version>
1819
</properties>
1920

2021
<dependencyManagement>
@@ -102,7 +103,7 @@
102103
<dependency>
103104
<groupId>io.javelit</groupId>
104105
<artifactId>javelit</artifactId>
105-
<version>0.86.0</version>
106+
<version>${javelit-version}</version>
106107
</dependency>
107108
<dependency>
108109
<groupId>io.quarkus</groupId>

src/main/docker/Dockerfile.jvm

Lines changed: 0 additions & 94 deletions
This file was deleted.

src/main/java/zenika/oss/stats/ressources/ContributionsRessources.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,8 @@ public ContributionsRessources(FirestoreServices firestoreServices) {
1919
this.firestoreServices = firestoreServices;
2020
}
2121

22-
/**
23-
* Get contributions for one member.
24-
*
25-
* @param memberId of the member requested
26-
* @return
27-
*/
2822
@GET
29-
@Path("/contributions/member/{memberId}")
23+
@Path("/member/{memberId}")
3024
public Response getContributionsByMember(@PathParam("memberId") String memberId) throws DatabaseException {
3125
return Response.ok(firestoreServices.getContributionsForAMemberOrderByYear(memberId)).build();
3226
}

0 commit comments

Comments
 (0)