From 5f9c47b95d8d51fb4da31e2e8e6886e0e8a89c0f Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Wed, 18 Feb 2026 15:32:12 +0200 Subject: [PATCH] maven --- proiect-nutritie-java/Dockerfile | 16 ++++ proiect-nutritie-java/Jenkinsfile | 40 +++++++++ proiect-nutritie-java/pom.xml | 10 +++ .../src/main/webapp/index.html | 81 +++++++++++++++++++ 4 files changed, 147 insertions(+) create mode 100644 proiect-nutritie-java/Dockerfile create mode 100644 proiect-nutritie-java/Jenkinsfile create mode 100644 proiect-nutritie-java/pom.xml create mode 100644 proiect-nutritie-java/src/main/webapp/index.html diff --git a/proiect-nutritie-java/Dockerfile b/proiect-nutritie-java/Dockerfile new file mode 100644 index 0000000..32729d4 --- /dev/null +++ b/proiect-nutritie-java/Dockerfile @@ -0,0 +1,16 @@ +# Docker va descărca singur Python și Pip în interiorul imaginii +FROM python:3.9-slim + +WORKDIR /app + +# Copiem fișierul de dependințe +COPY requirements.txt . + +# Aici Docker va rula 'pip install' în interiorul lui, nu pe Ubuntu al tău +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +EXPOSE 5000 + +CMD ["python", "app/main.py"] \ No newline at end of file diff --git a/proiect-nutritie-java/Jenkinsfile b/proiect-nutritie-java/Jenkinsfile new file mode 100644 index 0000000..6641e4f --- /dev/null +++ b/proiect-nutritie-java/Jenkinsfile @@ -0,0 +1,40 @@ +pipeline { + agent any + + tools { + maven 'MVN-WSL' + } + + stages { + stage('Checkout') { + steps { + checkout scm + } + } + + stage('Maven Analysis') { + steps { + sh 'mvn --version' + echo 'Maven a fost integrat cu succes în pipeline-ul de Python!' + } + } + + stage('Build Docker Image') { + steps { + dir('proiect-nutritie') { + sh 'docker build -t dieta-app-jenkins .' + } + } + } + + stage('Deploy') { + steps { + sh ''' + docker stop test-dieta || true + docker rm test-dieta || true + docker run -d -p 8085:5000 --name test-dieta dieta-app-jenkins + ''' + } + } + } +} \ No newline at end of file diff --git a/proiect-nutritie-java/pom.xml b/proiect-nutritie-java/pom.xml new file mode 100644 index 0000000..d1f4a97 --- /dev/null +++ b/proiect-nutritie-java/pom.xml @@ -0,0 +1,10 @@ + + 4.0.0 + com.nutritie + nutritie-webapp + war + 1.0-SNAPSHOT + Nutritie Java Edition + nutritie + \ No newline at end of file diff --git a/proiect-nutritie-java/src/main/webapp/index.html b/proiect-nutritie-java/src/main/webapp/index.html new file mode 100644 index 0000000..87c5cd5 --- /dev/null +++ b/proiect-nutritie-java/src/main/webapp/index.html @@ -0,0 +1,81 @@ + + + + + Nutriție AI Pro + + + +
+

Calculator Kcal & AI Menu

+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ + {% if rezultat %} +
+

Ținta ta: {{ rezultat }} kcal / zi

+
+
+ +
🤖 Cere meniu de la AI
+
+ + + + + + + + + +
+ {% endif %} + + {% if meniu_ai %} +
+
Meniul tău generat:
+

{{ meniu_ai }}

+
+ {% endif %} +
+
+ + \ No newline at end of file