diff --git a/k8s/app.yaml b/k8s/app.yaml index 2bc5515..02da9c0 100644 --- a/k8s/app.yaml +++ b/k8s/app.yaml @@ -34,6 +34,38 @@ spec: initialDelaySeconds: 10 periodSeconds: 10 failureThreshold: 3 + - name: python-service + image: python:3.11-slim + command: ['sh', '-c', 'pip install --no-cache-dir -r requirements.txt && uvicorn main:app --host 0.0.0.0 --port 8010'] + workingDir: /shared-code + ports: + - containerPort: 8010 + env: + - name: USE_LOCAL_DB + value: "true" + - name: LOCAL_DB_HOST + value: "192.168.8.151" + - name: LOCAL_DB_PORT + value: "5432" + - name: LOCAL_DB_USER + value: "postgres" + - name: LOCAL_DB_PASSWORD + value: "postgres" + - name: LOCAL_DB_NAME + value: "institutional_trader" + volumeMounts: + - name: shared-code + mountPath: /shared-code + initContainers: + - name: copy-python-code + image: 192.168.8.250:5000/market:latest + command: ['sh', '-c', 'cp -r /app/backend/python_service/* /shared-code/'] + volumeMounts: + - name: shared-code + mountPath: /shared-code + volumes: + - name: shared-code + emptyDir: {} --- apiVersion: v1 kind: Service