Deployed in oracle cloud kubernetes cluster

This commit is contained in:
mhdzumair
2024-01-22 17:51:10 +05:30
parent 318f8a0151
commit 2268df8b04
3 changed files with 153 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
.env
.idea/
*.service
http-client.private.env.json
127.0.0.1.pem
127.0.0.1-key.pem
resources/poster_cache
+22
View File
@@ -0,0 +1,22 @@
FROM python:3.11-slim-bullseye
WORKDIR /mediafusion
COPY ../Pipfile Pipfile.lock ./
# Install dependencies
RUN pip install --upgrade pip && \
pip install pipenv && \
apt-get update && \
apt-get install -y git
RUN pipenv install --deploy --ignore-pipfile
# Copy the source code
COPY .. .
# Expose the port
EXPOSE 80
CMD ["pipenv", "run", "uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "80"]
+93
View File
@@ -0,0 +1,93 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mediafusion-deployment
spec:
replicas: 2
selector:
matchLabels:
app: mediafusion
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
template:
metadata:
labels:
app: mediafusion
spec:
imagePullSecrets:
- name: ocirsecret
containers:
- name: mediafusion
image: ap-singapore-1.ocir.io/axykuon5aont/mediafusion:v3.6.5
ports:
- containerPort: 80
env:
- name: MONGO_URI
valueFrom:
secretKeyRef:
name: mediafusion-secrets
key: MONGO_URI
- name: SECRET_KEY
valueFrom:
secretKeyRef:
name: mediafusion-secrets
key: SECRET_KEY
- name: HOST_URL
value: "https://mediafusion.fun"
- name: ENABLE_SCRAPPER
value: "false"
- name: POSTER_CACHE_PATH
value: "/covers"
volumeMounts:
- name: mediafusion-volume
mountPath: /covers
livenessProbe:
httpGet:
path: /health
port: 80
initialDelaySeconds: 10
periodSeconds: 60
failureThreshold: 5
timeoutSeconds: 10
readinessProbe:
httpGet:
path: /health
port: 80
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 10
volumes:
- name: mediafusion-volume
persistentVolumeClaim:
claimName: mediafusion-pvc
---
apiVersion: v1
kind: Service
metadata:
name: mediafusion-service
spec:
selector:
app: mediafusion
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mediafusion-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi