mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 07:15:49 +00:00
Added Dockerfile and 2 yamls
This commit is contained in:
parent
6148ddd967
commit
bff52a78f9
3 changed files with 45 additions and 0 deletions
14
Dockerfile
Normal file
14
Dockerfile
Normal 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
19
deployment.yaml
Normal 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
12
service.yaml
Normal 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
|
Loading…
Reference in a new issue