Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Umi007 authored Jun 24, 2024
1 parent 9c0c4b1 commit b219844
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ WORKDIR /app
# Copy the JAR file from the build stage to the image
COPY --from=build /app/target/*.jar app.jar

# Copy the application properties file from the build context to the image
COPY src/main/resources/application.properties /config/application.properties
# Copy application properties
COPY src/main/resources/application.properties /app/config/application.properties
COPY src/main/resources/application-dev.properties /app/config/application-dev.properties

# Change ownership of the application JAR and config directory
RUN chown -R spring:spring /app/app.jar /config
# Change ownership of the application JAR
RUN chown -R spring:spring /app

# Switch to the non-root user
USER spring:spring

# Define the command to run your application
ENTRYPOINT ["java", "-jar", "app.jar"]
ENTRYPOINT ["java", "-jar", "app.jar", "--spring.config.location=/app/config/"]

0 comments on commit b219844

Please sign in to comment.