This commit is contained in:
root
2025-09-13 21:52:22 +05:00
parent 4757df4998
commit d3d7a95bdc
2 changed files with 5 additions and 7 deletions
+3 -5
View File
@@ -3,8 +3,7 @@ WORKDIR /app
COPY ./pom.xml ./
RUN mvn dependency:resolve
COPY . .
RUN mvn clean install
# -DskipTests
RUN mvn clean install -DskipTests
FROM openjdk:21-jdk-slim
@@ -17,12 +16,11 @@ RUN mkdir /dumps && chown appuser:appgroup /dumps
# Set the working directory
WORKDIR /app
# Copy the application jar and .env file from the build stage
# Copy the application jar from the build stage
COPY --from=build /app/target/*.jar app.jar
COPY --from=build /app/.env .env
# Change ownership of the application files to the non-root user
RUN chown appuser:appgroup app.jar .env
RUN chown appuser:appgroup app.jar
# Switch to the non-root user
USER appuser