apiVersion: app.sealos.io/v1
kind: Instance
metadata:
  name: chatgpt-midjourney-uqiirctv
  labels:
    cloud.sealos.io/deploy-on-sealos: chatgpt-midjourney-uqiirctv
spec:
  gitRepo: https://github.com/Licoy/ChatGPT-Midjourney
  templateType: inline
  categories:
    - ai
  defaults:
    app_host:
      type: string
      value: nylvbubg
    app_name:
      type: string
      value: chatgpt-midjourney-uqiirctv
  inputs:
    OPENAI_API_KEY:
      description: 这是你在 OpenAI 账户页面申请的 API 密钥
      type: string
      default: ''
      required: true
    BASE_URL:
      description: 如果你手动配置了 OpenAI 接口代理，可以使用此配置项来覆盖默认的 OpenAI API 请求基础 URL
      type: string
      default: ''
      required: false
    MJ_SERVER_ID:
      description: Discord 服务器 ID
      type: string
      default: ''
      required: true
    MJ_CHANNEL_ID:
      description: Discord 频道 ID
      type: string
      default: ''
      required: true
    MJ_USER_TOKEN:
      description: Discord 用户 Token
      type: string
      default: ''
      required: true
    MJ_DISCORD_PROXY:
      description: Discord 代理域名
      type: string
      default: https://discord.com
      required: false
    MJ_DISCORD_WSS_PROXY:
      description: Discord Websocket 代理域名
      type: string
      default: wss://gateway.discord.gg
      required: false
    MJ_DISCORD_CDN_PROXY:
      description: Discord CDN 代理域名
      type: string
      default: https://cdn.discordapp.com
      required: false
    CODE:
      description: 设置页面中的访问密码
      type: string
      default: ''
      required: false
  title: chatgpt-midjourney
  url: https://github.com/Licoy/ChatGPT-Midjourney
  author: Sealos
  description: One-click to own your own ChatGPT+StabilityAI+Midjourney web service
  readme: https://cdn.jsdelivr.net/gh/Licoy/ChatGPT-Midjourney@master/README.md
  icon: >-
    https://cdn.jsdelivr.net/gh/Licoy/ChatGPT-Midjourney@master/public/favicon.ico

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: chatgpt-midjourney-uqiirctv
  annotations:
    originImageName: licoy/chatgpt-midjourney:v3.2.3
    deploy.cloud.sealos.io/minReplicas: '1'
    deploy.cloud.sealos.io/maxReplicas: '1'
  labels:
    cloud.sealos.io/app-deploy-manager: chatgpt-midjourney-uqiirctv
    app: chatgpt-midjourney-uqiirctv
    cloud.sealos.io/deploy-on-sealos: chatgpt-midjourney-uqiirctv
spec:
  replicas: 1
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app: chatgpt-midjourney-uqiirctv
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 0
  template:
    metadata:
      labels:
        app: chatgpt-midjourney-uqiirctv
    spec:
      automountServiceAccountToken: false
      containers:
        - name: chatgpt-midjourney-uqiirctv
          image: licoy/chatgpt-midjourney:v3.2.3
          env:
            - name: OPENAI_API_KEY
              value: null
            - name: BASE_URL
              value: null
            - name: MJ_SERVER_ID
              value: null
            - name: MJ_CHANNEL_ID
              value: null
            - name: MJ_USER_TOKEN
              value: null
            - name: MJ_DISCORD_PROXY
              value: https://discord.com
            - name: MJ_DISCORD_WSS_PROXY
              value: wss://gateway.discord.gg
            - name: MJ_DISCORD_CDN_PROXY
              value: https://cdn.discordapp.com
            - name: CODE
              value: null
          resources:
            requests:
              cpu: 100m
              memory: 102Mi
            limits:
              cpu: 1000m
              memory: 1024Mi
          command: []
          args: []
          ports:
            - containerPort: 3000
          imagePullPolicy: IfNotPresent
          volumeMounts: []
      volumes: []

---
apiVersion: v1
kind: Service
metadata:
  name: chatgpt-midjourney-uqiirctv
  labels:
    cloud.sealos.io/app-deploy-manager: chatgpt-midjourney-uqiirctv
    cloud.sealos.io/deploy-on-sealos: chatgpt-midjourney-uqiirctv
spec:
  ports:
    - port: 3000
  selector:
    app: chatgpt-midjourney-uqiirctv

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: chatgpt-midjourney-uqiirctv
  labels:
    cloud.sealos.io/app-deploy-manager: chatgpt-midjourney-uqiirctv
    cloud.sealos.io/app-deploy-manager-domain: nylvbubg
    cloud.sealos.io/deploy-on-sealos: chatgpt-midjourney-uqiirctv
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/proxy-body-size: 32m
    nginx.ingress.kubernetes.io/server-snippet: |
      client_header_buffer_size 64k;
      large_client_header_buffers 4 128k;
    nginx.ingress.kubernetes.io/ssl-redirect: 'false'
    nginx.ingress.kubernetes.io/backend-protocol: HTTP
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/client-body-buffer-size: 64k
    nginx.ingress.kubernetes.io/proxy-buffer-size: 64k
    nginx.ingress.kubernetes.io/proxy-send-timeout: '300'
    nginx.ingress.kubernetes.io/proxy-read-timeout: '300'
    nginx.ingress.kubernetes.io/configuration-snippet: |
      if ($request_uri ~* \.(js|css|gif|jpe?g|png)) {
        expires 30d;
        add_header Cache-Control "public";
      }
spec:
  rules:
    - host: nylvbubg.sealoshzh.site
      http:
        paths:
          - pathType: Prefix
            path: /()(.*)
            backend:
              service:
                name: chatgpt-midjourney-uqiirctv
                port:
                  number: 3000
  tls:
    - hosts:
        - nylvbubg.sealoshzh.site
      secretName: wildcard-cert
