feat: Enhance Dockerfile security with non-root users and correct file permissions, and adjust Gitea workflow action versions.
This commit is contained in:
@@ -6,6 +6,11 @@ COPY src ./src
|
||||
RUN mvn package -DskipTests -B
|
||||
|
||||
FROM eclipse-temurin:17-jre-alpine
|
||||
|
||||
# Best practice: run as a non-root user
|
||||
RUN addgroup -S spring && adduser -S spring -G spring
|
||||
USER spring:spring
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/target/app.jar app.jar
|
||||
EXPOSE 8080
|
||||
|
||||
Reference in New Issue
Block a user