Spaces:
Runtime error
Runtime error
Download Dockerfile from Krishna0718/mymedia-java-backend: direct link, hf CLI and curl.
- Browser
- Download file 635 Bytes
-
https://huggingface.co/spaces/Krishna0718/mymedia-java-backend/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Krishna0718/mymedia-java-backend/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Krishna0718/mymedia-java-backend/resolve/main/Dockerfile
635 Bytes
| # -------- Stage 1: Build the Spring Boot application -------- | |
| FROM maven:3.9.6-eclipse-temurin-21 AS build | |
| # Create a working directory | |
| WORKDIR /app | |
| # Copy the Maven project files | |
| COPY pom.xml . | |
| COPY src ./src | |
| # Build the project (skip tests to speed up) | |
| RUN mvn clean package -DskipTests | |
| # -------- Stage 2: Create a lightweight runtime image -------- | |
| FROM openjdk:21-jdk | |
| # Set working directory in runtime container | |
| WORKDIR /app | |
| # Copy the built jar file from the build stage | |
| COPY --from=build /app/target/*.jar app.jar | |
| # Expose the Spring Boot default port | |
| EXPOSE 7860 | |
| # Run the app | |
| ENTRYPOINT ["java", "-jar", "app.jar"] | |