Added Dockerfile and 2 yamls

This commit is contained in:
Prithviraj Ghosh 2025-01-15 06:28:59 +05:30
parent 6148ddd967
commit bff52a78f9
3 changed files with 45 additions and 0 deletions

14
Dockerfile Normal file
View file

@ -0,0 +1,14 @@
# Use a base Java image
FROM openjdk:17-jdk-slim
# Set the working directory
WORKDIR /app
# Copy the JAR file built by Maven
COPY target/*.jar app.jar
# Expose the application port
EXPOSE 8080
# Command to run the application
ENTRYPOINT ["java", "-jar", "app.jar"]

19
deployment.yaml Normal file
View file

@ -0,0 +1,19 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: spring-petclinic-deployment
spec:
replicas: 2
selector:
matchLabels:
app: spring-petclinic
template:
metadata:
labels:
app: spring-petclinic
spec:
containers:
- name: spring-petclinic
image: prithvirajpro/spring-petclinic
ports:
- containerPort: 8080

12
service.yaml Normal file
View file

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: spring-petclinic-service
spec:
selector:
app: spring-petclinic
ports:
- protocol: TCP
port: 80
targetPort: 8080
type: NodePort