Skip to content

Commit c5567fa

Browse files
author
eks
committed
added db and updated dockerfile
1 parent 2556685 commit c5567fa

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

spring-backend/Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
# Stage 1: Build Maven project with JDK 11
2+
FROM maven:3.8.4-openjdk-11 AS build
3+
WORKDIR /app
4+
COPY . .
5+
RUN mvn clean install
6+
7+
# Stage 2: Run the application with JDK 11
18
FROM openjdk:11
2-
VOLUME /tmp
3-
ARG JAR_FILE=target/*.jar
4-
COPY ${JAR_FILE} app.jar
5-
ENTRYPOINT ["java","-jar","/app.jar"]
9+
WORKDIR /app
10+
COPY --from=build /app/target/*.jar app.jar
11+
ENTRYPOINT ["java", "-jar", "app.jar"]

spring-backend/src/main/resources/application.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ cloudinary.api-key=******
22
cloudinary.api-secret=*****
33
cloudinary.cloud-name=******
44
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
5-
spring.datasource.password=1
6-
spring.datasource.url=jdbc:mysql://localhost:3306/hobbie_backend_db?allowPublicKeyRetrieval=true&useSSL=false&createDatabaseIfNotExist=true&useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Europe/Paris
7-
spring.datasource.username=root
5+
spring.datasource.password=gZ3XEYz28B6zBG
6+
spring.datasource.url=jdbc:mysql://ecommerce.czig6eqcivbd.us-east-1.rds.amazonaws.com:3306/hobbie_backend_db?allowPublicKeyRetrieval=true&useSSL=false&createDatabaseIfNotExist=true&useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Europe/Paris
7+
spring.datasource.username=admin
88
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
99
spring.jpa.hibernate.ddl-auto=create
1010
spring.jpa.hibernate.use-new-id-generator-mappings=false

0 commit comments

Comments
 (0)