apiVersion: apps/v1
kind: Deployment
metadata:
  name:  web
  labels:
    app:  web
spec:
  selector:
    matchLabels:
      app: web
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app:  web
    spec:
      imagePullSecrets:
        - name: docker-credentials
      volumes:
        - name: cache
          emptyDir: {}
        - name: testing
          emptyDir: {}
        - name: views
          emptyDir: {}
        - name: app-storage
          emptyDir: {}
      securityContext:
        fsGroup: 1000
      containers:
      - name: web
        image: ghcr.io/rendyananta/urlhub:${APP_VERSION}
        imagePullPolicy: Always
        resources:
          limits:
            cpu: 200m
            memory: 300Mi
        envFrom:
          - configMapRef:
              name: app
          - secretRef:
              name: app
        ports:
          - containerPort: 8000
            name: web
