Add of DockerFiles Frontend/Backend & change of files

This commit is contained in:
Charles Mendiburu 2026-03-28 11:30:03 +01:00
parent b234e1f7a1
commit eb4df189bb
10 changed files with 102 additions and 16 deletions

25
Back-end/Dockerfile Normal file
View File

@ -0,0 +1,25 @@
# Stage 1: Build the Maven artifact
FROM maven:3.9-eclipse-temurin-17 AS build
WORKDIR /app
# Optimize build by caching dependencies where possible
COPY pom.xml .
# Download dependencies
RUN mvn dependency:go-offline -B
# Copy source code and build the JAR
COPY src ./src
RUN mvn clean package -DskipTests
# Stage 2: Setup the runtime environment
FROM eclipse-temurin:17-jre
WORKDIR /app
# Copy the constructed fat JAR from the builder stage
COPY --from=build /app/target/starter-1.0.0-SNAPSHOT-fat.jar ./app.jar
COPY keystore.jceks ./
EXPOSE 8888
# Start the Vert.x application
ENTRYPOINT ["java", "-jar", "app.jar"]

View File

@ -115,6 +115,16 @@
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">

View File

@ -12,9 +12,9 @@ public class DatabaseService {
public DatabaseService(Vertx vertx) {
pool = JDBCPool.pool(vertx,
new JDBCConnectOptions()
.setJdbcUrl("jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=UTF-8") //Url de la bdd
.setUser("postgres") // Nom d'utilisateur PostgreSQL
.setPassword("admin"), // Mot de passe PostgreSQL
.setJdbcUrl("jdbc:postgresql://" + (System.getenv("DB_HOST") != null ? System.getenv("DB_HOST") : "localhost") + ":" + (System.getenv("DB_PORT") != null ? System.getenv("DB_PORT") : "5432") + "/" + (System.getenv("DB_NAME") != null ? System.getenv("DB_NAME") : "postgres") + "?useUnicode=true&characterEncoding=UTF-8")
.setUser(System.getenv("DB_USER") != null ? System.getenv("DB_USER") : "postgres")
.setPassword(System.getenv("DB_PASSWORD") != null ? System.getenv("DB_PASSWORD") : "admin"),
new PoolOptions()
.setName("")
.setMaxSize(16)

25
Front-end/Dockerfile Normal file
View File

@ -0,0 +1,25 @@
# Stage 1: Build the React application
FROM node:18-alpine AS build
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2: Serve the application using Nginx
FROM nginx:alpine
# Remove default Nginx static assets
RUN rm -rf /usr/share/nginx/html/*
# Copy built app from the first stage
COPY --from=build /app/dist /usr/share/nginx/html
# Replace the default Nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="./src/img/cloud-sun-rain.svg"/>
<link rel="icon" href=".//img/cloud-sun-rain.svg"/>
<title>Projet Dev Web</title>
</head>
<body>

12
Front-end/nginx.conf Normal file
View File

@ -0,0 +1,12 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Fallback to index.html for Single Page Applications handling client-side routing
location / {
try_files $uri $uri/ /index.html;
}
}

View File

@ -88,6 +88,7 @@
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz",
"integrity": "sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==",
"dev": true,
"peer": true,
"dependencies": {
"@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.26.2",
@ -390,6 +391,7 @@
"resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.14.0.tgz",
"integrity": "sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA==",
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/runtime": "^7.18.3",
"@emotion/babel-plugin": "^11.13.5",
@ -433,6 +435,7 @@
"resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.14.0.tgz",
"integrity": "sha512-XxfOnXFffatap2IyCeJyNov3kiDQWoR08gPUQxvbL7fxKryGBKUZUkG6Hz48DZwVrJSVh9sJboyV1Ds4OW6SgA==",
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/runtime": "^7.18.3",
"@emotion/babel-plugin": "^11.13.5",
@ -1786,6 +1789,7 @@
"resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.85.tgz",
"integrity": "sha512-5oBDUsRDsrYq4DdyHaL99gE1AJCfuDhyxqF6/55fvvOIRkp1PpKuwJ+aMiGJR+GJt7YqMNclPROTHF20vY2cXA==",
"license": "MIT",
"peer": true,
"dependencies": {
"@types/prop-types": "*",
"@types/scheduler": "^0.16",
@ -1840,6 +1844,7 @@
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz",
"integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==",
"dev": true,
"peer": true,
"bin": {
"acorn": "bin/acorn"
},
@ -2218,6 +2223,7 @@
"url": "https://github.com/sponsors/ai"
}
],
"peer": true,
"dependencies": {
"caniuse-lite": "^1.0.30001688",
"electron-to-chromium": "^1.5.73",
@ -2298,9 +2304,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001707",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001707.tgz",
"integrity": "sha512-3qtRjw/HQSMlDWf+X79N206fepf4SOOU6SQLMaq/0KkZLmSjPxAkBOQQ+FxbHKfHmYLZFfdWsO3KA90ceHPSnw==",
"version": "1.0.30001781",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001781.tgz",
"integrity": "sha512-RdwNCyMsNBftLjW6w01z8bKEvT6e/5tpPVEgtn22TiLGlstHOVecsX2KHFkD5e/vRnIE4EGzpuIODb3mtswtkw==",
"dev": true,
"funding": [
{
@ -2315,7 +2321,8 @@
"type": "github",
"url": "https://github.com/sponsors/ai"
}
]
],
"license": "CC-BY-4.0"
},
"node_modules/chalk": {
"version": "4.1.2",
@ -3052,6 +3059,7 @@
"integrity": "sha512-jV7AbNoFPAY1EkFYpLq5bslU9NLNO8xnEeQXwErNibVryjk67wHVmddTBilc5srIttJDBrB0eMHKZBFbSIABCw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.12.1",
@ -4301,6 +4309,7 @@
"resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz",
"integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==",
"dev": true,
"peer": true,
"bin": {
"jiti": "bin/jiti.js"
}
@ -4959,6 +4968,7 @@
"url": "https://github.com/sponsors/ai"
}
],
"peer": true,
"dependencies": {
"nanoid": "^3.3.8",
"picocolors": "^1.1.1",
@ -5148,6 +5158,7 @@
"version": "18.3.1",
"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
"integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
"peer": true,
"dependencies": {
"loose-envify": "^1.1.0"
},
@ -5200,6 +5211,7 @@
"resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz",
"integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==",
"license": "MIT",
"peer": true,
"dependencies": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
@ -5238,6 +5250,7 @@
"version": "18.3.1",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",
"integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",
"peer": true,
"dependencies": {
"loose-envify": "^1.1.0",
"scheduler": "^0.23.2"
@ -6400,6 +6413,7 @@
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.15.tgz",
"integrity": "sha512-6ANcZRivqL/4WtwPGTKNaosuNJr5tWiftOC7liM7G9+rMb8+oeJeyzymDu4rTN93seySBmbjSfsS3Vzr19KNtA==",
"dev": true,
"peer": true,
"dependencies": {
"esbuild": "^0.21.3",
"postcss": "^8.4.43",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

View File

@ -32,7 +32,7 @@ function WindInfo({ object, setGraphStates, graphStates, graphRefs, reference})
{lastData ? (
<div className="flex flex-col items-center gap-1">
<img
src={`./src/img/${lastData.wind_direction}.png`}
src={`.//img/${lastData.wind_direction}.png`}
alt="Wind Direction"
className="h-25"
/>

View File

@ -25,14 +25,14 @@ function About() {
</div>
<img
className="rounded-lg h-64 w-full object-cover order-2 md:order-2"
src="./src/img/NotreMission.png"
src="/img/NotreMission.png"
alt="Notre mission"
/>
{/* Section Qui sommes-nous */}
<img
className="rounded-lg h-64 w-full object-cover order-4 md:order-3"
src="./src/img/iotmeteo.jpg"
src="/img/iotmeteo.jpg"
alt="IoT et météo"
/>
<div className="order-3 md:order-4">
@ -70,7 +70,7 @@ function About() {
</div>
<img
className="rounded-lg h-64 w-full object-cover order-6 md:order-6"
src="./src/img/surveillancemeteo.webp"
src="/img/surveillancemeteo.webp"
alt="Surveillance météo"
/>
</div>
@ -84,7 +84,7 @@ function About() {
{/* Objectif 1 */}
<div className="relative group w-full h-80 mb-7">
<img
src="./src/img/surveillancetempsreel.jpg"
src="/img/surveillancetempsreel.jpg"
alt="Surveillance en temps réel"
className="w-full h-full object-cover rounded-xl"
/>
@ -104,7 +104,7 @@ function About() {
{/* Objectif 2 */}
<div className="relative group w-full h-80 mb-7">
<img
src="./src/img/precisionfiable.jpg"
src="/img/precisionfiable.jpg"
alt="Précision fiable"
className="w-full h-full object-cover rounded-xl"
/>
@ -122,7 +122,7 @@ function About() {
{/* Objectif 3 */}
<div className="relative group w-full h-80 mb-7 border-2 rounded-xl">
<img
src="./src/img/gestioniot.png"
src="/img/gestioniot.png"
alt="Gestion IoT"
className="w-full h-full object-cover rounded-xl"
/>
@ -142,7 +142,7 @@ function About() {
{/* Objectif 4 */}
<div className="relative group w-full h-80 mb-7">
<img
src="./src/img/fr-alert.webp"
src="/img/fr-alert.webp"
alt="Réponse rapide"
className="w-full h-full object-cover rounded-xl"
/>