KevanSoon commited on
Commit
ca3dfa7
·
1 Parent(s): 082e859

Changed to springboot

Browse files
Files changed (1) hide show
  1. Dockerfile +0 -13
Dockerfile CHANGED
@@ -1,25 +1,12 @@
1
- # Use the official Maven image for building the application
2
  FROM maven:3.9.6-eclipse-temurin-17 AS build
3
  WORKDIR /app
4
-
5
- # Copy the full source code
6
  COPY . .
7
-
8
- # Build the application - produces a target/*.jar
9
  RUN mvn clean package -DskipTests
10
 
11
- # Use a minimal Java runtime for running the app
12
  FROM eclipse-temurin:17-jre
13
- RUN useradd -m -u 1000 user
14
- USER user
15
  WORKDIR /home/user/app
16
-
17
- # Copy the jar from the builder stage
18
  COPY --from=build /app/target/*.jar ./app.jar
19
 
20
- # The app must listen on port 7860 for Hugging Face Spaces
21
  ENV PORT=7860
22
  EXPOSE 7860
23
-
24
- # Optionally, pass --server.port=7860 to Spring Boot
25
  CMD ["java", "-jar", "app.jar", "--server.port=7860"]
 
 
1
  FROM maven:3.9.6-eclipse-temurin-17 AS build
2
  WORKDIR /app
 
 
3
  COPY . .
 
 
4
  RUN mvn clean package -DskipTests
5
 
 
6
  FROM eclipse-temurin:17-jre
 
 
7
  WORKDIR /home/user/app
 
 
8
  COPY --from=build /app/target/*.jar ./app.jar
9
 
 
10
  ENV PORT=7860
11
  EXPOSE 7860
 
 
12
  CMD ["java", "-jar", "app.jar", "--server.port=7860"]