Create Containerfile

This commit is contained in:
Waseem Ahammed 2024-06-04 23:58:05 +05:30 committed by GitHub
parent d8fcd11e67
commit 6ee4338adc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

20
Containerfile Normal file
View file

@ -0,0 +1,20 @@
# Start with a base image containing Java runtime
FROM openjdk:21
# Add Maintainer Info
LABEL maintainer="waseemahammed96@gmail.com"
# Add a volume pointing to /mnt/artefact
VOLUME /mnt/artefact
# Make port 8080 available to the world outside this container
EXPOSE 8080
# The application's jar file
ARG JAR_FILE=$PWD/target/*.jar
# Add the application's jar to the container
ADD ${JAR_FILE} spring-petclinic-service.jar
# Run the jar file
ENTRYPOINT ["java","-Dserver.port=8080","-Dspring.profiles.active=default","-jar","/spring-petclinic-service.jar"]