example-configuration/bot-api.yaml

55 lines
1.3 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: bot-api
spec:
replicas: 1
selector:
matchLabels:
app: bot-api
template:
metadata:
labels:
app: bot-api
spec:
containers:
- name: bot-api
image: git.fai.st/fedi-image-bot/bot-api:v1.0.0
resources:
limits:
cpu: "500m" # 500 milliCPU
memory: "512Mi" # 512 Mebibytes
ports:
- containerPort: 3000 # Port your Express app is running on
env:
- name: PORT
value: "3000"
- name: MONGODB_URI
value: "mongodb://mongo.svc:27017/bot" # Replace with your DB URL
- name: MONGODB_USER
valueFrom:
secretKeyRef:
name: mongo-creds
key: username
- name: MONGODB_PASS
valueFrom:
secretKeyRef:
name: mongo-creds
key: password
- name: JWTSECRET
value: ""
---
apiVersion: v1
kind: Service
metadata:
name: bot-api-service
spec:
type: NodePort
selector:
app: bot-api
ports:
- protocol: TCP
port: 3000 # Port you want to expose externally
targetPort: 3000 # Port your Express app is running on inside the container
nodePort: 30000