we commited on
Commit
a2d5548
·
1 Parent(s): d7c74f7
Dockerfile CHANGED
@@ -14,5 +14,5 @@ COPY --from=build /user.properties user.properties
14
  COPY --from=build /urls.txt urls.txt
15
  COPY --from=build /mydb.db mydb.db
16
  # ENV PORT=8080
17
- EXPOSE 8081
18
  ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-jar","demo.jar"]
 
14
  COPY --from=build /urls.txt urls.txt
15
  COPY --from=build /mydb.db mydb.db
16
  # ENV PORT=8080
17
+ EXPOSE 7860
18
  ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-jar","demo.jar"]
README.md CHANGED
@@ -1,80 +1,11 @@
1
- # Deploy Sprint Boot And Postegres on Render with Web Services and Docker
2
-
3
- ## Creat Spring Boot Project
4
-
5
- https://start.spring.io/
6
-
7
- ## Add Dependencies Web : spring-boot-starter-web
8
-
9
- <dependency>
10
- <groupId>org.springframework.boot</groupId>
11
- <artifactId>spring-boot-starter-web</artifactId>
12
- </dependency>
13
-
14
- ## Add Dependencies JPA
15
-
16
- <dependency>
17
- <groupId>org.springframework.boot</groupId>
18
- <artifactId>spring-boot-starter-data-jpa</artifactId>
19
- </dependency>
20
-
21
- ## Add Dependencies PostegreSql : postgresql
22
-
23
- <dependency>
24
- <groupId>org.postgresql</groupId>
25
- <artifactId>postgresql</artifactId>
26
- <scope>runtime</scope>
27
- </dependency>
28
-
29
-
30
- ### Create Dockerfile at the root folder
31
-
32
- #
33
- # Build stage
34
- #
35
- FROM maven:3.8.2-jdk-11 AS build
36
- COPY . .
37
- RUN mvn clean package -Pprod -DskipTests
38
-
39
- #
40
- # Package stage
41
- #
42
- FROM openjdk:11-jdk-slim
43
- COPY --from=build /target/demo-0.0.1-SNAPSHOT.jar demo.jar
44
- # ENV PORT=8080
45
- EXPOSE 8080
46
- ENTRYPOINT ["java","-jar","demo.jar"]
47
-
48
-
49
- ### Building a Dockerfile from the root folder
50
- By default docker uses the Dockerfile of the current folder if you run a single command like
51
- Run: docker build -t spring-boot-render .
52
-
53
- ### Run image with docker on localhost
54
- Run docker run -p 8080:8080 spring-boot-render
55
-
56
-
57
- ## Create Postegres database from Render.com
58
- https://dashboard.render.com/
59
-
60
-
61
- ### Modify connections params on application.properties
62
-
63
- server.tomcat.accesslog.enabled=true
64
-
65
- spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
66
- spring.jpa.hibernate.ddl-auto=update
67
- spring.jpa.hibernate.show-sql=true
68
-
69
- spring.datasource.url=jdbc:postgresql://dpg-{custom-url}.render.com:5432/{name_database}
70
- spring.datasource.username=your_username
71
- spring.datasource.password=your_passeword
72
- spring.datasource.driver-class-name=org.postgresql.Driver
73
-
74
-
75
- ### Creat new Web Service app
76
-
77
-
78
- ## DEMO
79
-
80
- [![IMAGE ALT TEXT HERE](https://github.com/TakiRahal/spring-boot-render/blob/main/src/main/resources/static/spring_boot_render.png)](https://youtu.be/-Ih_ky5HMEA)
 
1
+ ---
2
+ title: EnterpriseAIHub
3
+ emoji: 🔥
4
+ colorFrom: green
5
+ colorTo: yellow
6
+ sdk: docker
7
+ pinned: false
8
+ license: mit
9
+ ---
10
+
11
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/main/resources/application.properties CHANGED
@@ -6,3 +6,4 @@ spring.jpa.database-platform=com.sqlite.config.SQLiteDialect
6
  spring.jpa.hibernate.ddl-auto=create
7
  spring.jpa.show-sql=true
8
  spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.EJB3NamingStrategy
 
 
6
  spring.jpa.hibernate.ddl-auto=create
7
  spring.jpa.show-sql=true
8
  spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.EJB3NamingStrategy
9
+ server.port=7860