diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..3c9ae68 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,41 @@ +version: '3.8' + +services: + mysql: + image: mysql:8.0 + container_name: mysql-cont2 + environment: + - MYSQL_ROOT_PASSWORD + - MYSQL_DATABASE + - MYSQL_PASSWORD + ports: + - "3307:3306" + volumes: + - mysql-data:/var/lib/mysql + networks: + - my_network + restart: on-failure + + app: + build: . + container_name: springboot-app + ports: + - "8080:8080" + environment: + - SPRING_DATASOURCE_URL + - SPRING_DATASOURCE_USERNAME + - SPRING_DATASOURCE_PASSWORD + - SPRING_JPA_HIBERNATE_DDL_AUTO + - SPRING_JPA_SHOW_SQL + networks: + - my_network + depends_on: + - mysql + restart: on-failure + +volumes: + mysql-data: {} + +networks: + my_network: {} + \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..60b02d1 --- /dev/null +++ b/dockerfile @@ -0,0 +1,17 @@ +# Stage 1: Build stage +FROM maven:3.8.1-openjdk-17 AS build +WORKDIR /app +COPY pom.xml . +RUN mvn dependency:go-offline -B +COPY src ./src +RUN mvn clean package -DskipTests + +# Stage 2: Run stage +FROM openjdk:17-jdk-slim +WORKDIR /app +COPY --from=build /app/target/rihal-0.0.1-SNAPSHOT.jar app.jar + +EXPOSE 8080 + +# Correct CMD syntax +CMD ["java", "-jar", "app.jar"] diff --git a/target/classes/application.properties b/target/classes/application.properties new file mode 100644 index 0000000..9cc6243 --- /dev/null +++ b/target/classes/application.properties @@ -0,0 +1,9 @@ +spring.application.name=rihal +spring.datasource.url=${SPRING_DATASOURCE_URL} +spring.datasource.username=${SPRING_DATASOURCE_USERNAME} +spring.datasource.password=${SPRING_DATASOURCE_PASSWORD} +spring.jpa.hibernate.ddl-auto=update +spring.jpa.show-sql=true +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + diff --git a/target/classes/templates/edit_user.html b/target/classes/templates/edit_user.html new file mode 100644 index 0000000..8346537 --- /dev/null +++ b/target/classes/templates/edit_user.html @@ -0,0 +1,17 @@ + + + + + Edit User + + +

Edit User

+
+ +
+ +
+ +
+ + diff --git a/target/classes/templates/index.html b/target/classes/templates/index.html new file mode 100644 index 0000000..437d263 --- /dev/null +++ b/target/classes/templates/index.html @@ -0,0 +1,32 @@ + + + + + User Management + + +

User Management

+Add New User + + + + + + + + + + + + + + + + + +
IDNameEmailActions
+ Edit + Delete +
+ + diff --git a/target/classes/templates/new_user.html b/target/classes/templates/new_user.html new file mode 100644 index 0000000..14e04e3 --- /dev/null +++ b/target/classes/templates/new_user.html @@ -0,0 +1,17 @@ + + + + + Add New User + + +

Add New User

+
+ +
+ +
+ +
+ + diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..c66596b --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=rihal +groupId=com.docker +version=0.0.1-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..a0c6c2b --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,5 @@ +com/docker/rihal/controllers/UserController.class +com/docker/rihal/RihalApplication.class +com/docker/rihal/models/User.class +com/docker/rihal/repositories/UserRepository.class +com/docker/rihal/services/UserService.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..aa357e5 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,5 @@ +/home/f6ew/UserInfoStoreApp/src/main/java/com/docker/rihal/RihalApplication.java +/home/f6ew/UserInfoStoreApp/src/main/java/com/docker/rihal/controllers/UserController.java +/home/f6ew/UserInfoStoreApp/src/main/java/com/docker/rihal/models/User.java +/home/f6ew/UserInfoStoreApp/src/main/java/com/docker/rihal/repositories/UserRepository.java +/home/f6ew/UserInfoStoreApp/src/main/java/com/docker/rihal/services/UserService.java diff --git a/target/rihal-0.0.1-SNAPSHOT.jar.original b/target/rihal-0.0.1-SNAPSHOT.jar.original new file mode 100644 index 0000000..461208f Binary files /dev/null and b/target/rihal-0.0.1-SNAPSHOT.jar.original differ