resume-parser / Dockerfile
hari7775's picture
Chore: limit JVM memory and use Serial GC for container stability
93fe122
Raw History Blame Contribute Delete
577 Bytes
# Build stage
FROM maven:3.9.6-eclipse-temurin-17-alpine AS build
WORKDIR /app
COPY pom.xml .
# Download dependencies for caching
RUN mvn dependency:go-offline
COPY src ./src
RUN mvn clean package -DskipTests
# Run stage
FROM eclipse-temurin:17-jre-alpine
# Create a user with UID 1000 as required by Hugging Face
RUN adduser -D -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
COPY --from=build --chown=user:user /app/target/*.jar app.jar
EXPOSE 7860
ENTRYPOINT ["java", "-XX:+UseSerialGC", "-Xmx512m", "-jar", "app.jar"]