# onepanel-core-ui deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: onepanel-core-ui
  labels:
    app: onepanel-core-ui
  namespace: onepanel
spec:
  template:
    metadata:
      name: onepanel-core-ui
      labels:
        app: onepanel-core-ui
    spec:
      automountServiceAccountToken: false
      containers:
        - name: onepanel-core-ui
          image: onepanel/core-ui:$(applicationCoreuiImageTag)
          imagePullPolicy: $(applicationCoreuiImagePullPolicy)
          command:
            - "/bin/sh"
            - "-c"
          args:
            - find /usr/share/nginx/html/ -name '*.js' -type f -exec sed -i -e 's/<baseUrl>/$(applicationApiUrl)/g' {} \; ;
               find /usr/share/nginx/html/ -name '*.js' -type f -exec sed -i -e 's/<baseWSurl>/$(applicationApiWsUrl)/g' {} \; ;
               nginx -g 'daemon off;'
          ports:
            - containerPort: 4200
            - containerPort: 80
  selector:
    matchLabels:
      app: onepanel-core-ui