apiVersion: apps/v1
kind: Deployment
metadata:
  name: front-door-lock
spec:
  replicas: 1
  selector:
    matchLabels:
      app: front-door-lock
  template:
    metadata:
      labels:
        app: front-door-lock
    spec:

      volumes:
        - name: nginx-conf
          configMap:
            name: front-door-lock-nginx-conf
      containers:
        - name: proxy
          image: docker.io/nginx:1.21.6
          ports:
            - containerPort: 80
          volumeMounts:
            - { name: nginx-conf, mountPath: "/etc/nginx/" }
        - name: front-door-lock-vite
          image: reg:5000/front_door_lock_image
          ports:
            - containerPort: 8002
          command:
            - pnpm
            - exec
            - vite
            - --port=8002
        - name: front-door-lock-py
          image: reg:5000/front_door_lock_image
          ports:
            - containerPort: 8001
          command:
          - pdm
          - run
          - uvicorn
          - '--port=8001'
          - '--host=0.0.0.0'
          - '--reload'
          - 'front_door_lock:app'
---
apiVersion: v1
kind: Service
metadata:
  name: front-door-lock
spec:
  ports:
  - {port: 80, targetPort: 80}
  selector:
    app: front-door-lock
