Skip to content

Commit

Permalink
Docker changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek081141 committed Jul 7, 2024
1 parent 73dc96d commit 306c253
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
40 changes: 40 additions & 0 deletions deployment/mongo-db-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongodb
spec:
replicas: 1
selector:
matchLabels:
app: mongodb
template:
metadata:
labels:
app: mongodb
spec:
containers:
- name: mongodb
image: mongo:latest
ports:
- containerPort: 27017
env:
- name: MONGO_INITDB_DATABASE
value: mongoboot
volumeMounts:
- mountPath: /data/db
name: mongo-data
volumes:
- name: mongo-data
hostPath:
path: /Users/Shared/mongo-db/data
---
apiVersion: v1
kind: Service
metadata:
name: mongodb
spec:
ports:
- port: 27017
targetPort: 27017
selector:
app: mongodb
41 changes: 41 additions & 0 deletions deployment/my-springboot-mongo-app-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-springboot-mongo-app
spec:
replicas: 1
selector:
matchLabels:
app: my-springboot-mongo-app
template:
metadata:
labels:
app: my-springboot-mongo-app
spec:
containers:
- name: my-springboot-mongo-app
image: vivek081141/my-springboot-mongo-app:latest
ports:
- containerPort: 18012
env:
- name: SPRING_DATA_MONGODB_HOST
value: mongodb
- name: SPRING_DATA_MONGODB_PORT
value: "27017"
- name: SPRING_DATA_MONGODB_DATABASE
value: mongoboot
- name: SPRING_PROFILES_ACTIVE
value: prod
nodeSelector:
kubernetes.io/arch: arm64
---
apiVersion: v1
kind: Service
metadata:
name: my-springboot-mongo-app
spec:
ports:
- port: 18012
targetPort: 18012
selector:
app: my-springboot-mongo-app

0 comments on commit 306c253

Please sign in to comment.