Spaces:
Sleeping
Sleeping
File size: 659 Bytes
685180e a1f4435 872e5c6 685180e 872e5c6 685180e 872e5c6 685180e a1f4435 685180e 872e5c6 685180e 29b6132 872e5c6 685180e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# Use the official Maven image for building the application
FROM maven:3.9.6-eclipse-temurin-17 AS build
WORKDIR /app
# Copy the full source code
COPY . .
# Build the application - produces a target/*.jar
RUN mvn clean package -DskipTests
# Use a minimal Java runtime for running the app
FROM eclipse-temurin:17-jre
RUN useradd -m -u 1000 user
USER user
WORKDIR /home/user/app
# Copy the jar from the builder stage
COPY --from=build /app/target/*.jar ./app.jar
# The app must listen on port 7860 for Hugging Face Spaces
ENV PORT=7860
EXPOSE 7860
# Optionally, pass --server.port=7860 to Spring Boot
CMD ["java", "-jar", "app.jar", "--server.port=7860"]
|