apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend-deploy
spec:
  replicas: 1
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      imagePullSecrets:
      - name: gitea-registry-secret
      containers:
      - name: web
        image: gitea.cruzcloud.net/devops/ecommerce-frontend:v1.0.77
        ports:
        - containerPort: 80
        env:
        - name: HEADLESS_PROVIDER
          value: medusa
        - name: MEDUSA_BACKEND_URL
          value: http://medusa-svc:9000
        envFrom:
        - secretRef:
            name: commerce-storefront
---
apiVersion: v1
kind: Service
metadata:
  name: frontend-svc
spec:
  selector:
    app: frontend
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80