apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  name: "web"
  labels:
    app: "web"
spec:
  replicas: 1
  selector:
    app: "web"
  template:
    metadata:
      labels:
        app: "web"
    spec:
      containers:
      - image: registry.access.redhat.com/ubi8/nginx-118
        name: nginx
        imagePullPolicy: IfNotPresent
        args:
        - nginx
        - "-g"
        - "daemon off;"
        ports:
        - containerPort: 8080
          protocol: TCP
        volumeMounts:
        - name: nginx-data
          mountPath: /opt/app-root/src
          subPath: public
        - name: nginx-data
          subPath: logs
          mountPath: /var/log/nginx
        resources:
          limits:
            cpu: 20m
            memory: 250Mi
          requests:
            cpu: '0'
            memory: 10Mi
      volumes:
      - name: nginx-data
        persistentVolumeClaim:
          claimName: "languages-storage{{ '-stg' if env == 'staging' else '' }}"
      restartPolicy: Always
  triggers:
  - type: ConfigChange
  - type: ImageChange
    imageChangeParams:
      automatic: true
      from:
        kind: ImageStreamTag
        name: nginx:latest
      containerNames:
      - "nginx"
