.
This commit is contained in:
+3
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user