feat: Enhance Dockerfile security with non-root users and correct file permissions, and adjust Gitea workflow action versions.
This commit is contained in:
1 parent
d69eab1c12
commit
04feb5a3c3
3 files changed
+16
-8
No files matched your search
@@ -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