# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: VoAPI Final
spec:
    description: Final clean VoAPI service wired to the working MySQL and Redis services.
    icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/docker.svg
    tags:
        - AI
        - API
    readme: ""
    services:
        - name: voapi-live
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/docker.svg
          template: PREBUILT
          spec:
            id: voapi-live
            source:
                image: voapi/voapi:latest
            ports:
                - id: web
                  port: 6800
                  type: HTTP
            volumes:
                - id: file
                  dir: /file
                - id: public
                  dir: /public
            env:
                MYSQL_DSN:
                    default: voapi:voapi123@tcp(db-voapi-tonema.zeabur.internal:3306)/voapi
                MYSQL_LOG_BODY_DSN:
                    default: voapi:voapi123@tcp(db-voapi-tonema.zeabur.internal:3306)/voapi-body-log
                MYSQL_LOG_DSN:
                    default: voapi:voapi123@tcp(db-voapi-tonema.zeabur.internal:3306)/voapi-log
                REDIS_URI:
                    default: redis://redis-voapi-gent.zeabur.internal:6379/0
                TZ:
                    default: Asia/Shanghai
            configs:
                - path: /config.yml
                  template: |-
                    app:
                      port: 6800

                    db:
                      dirver: mysql
                      log-dirver: mysql

                    mysql:
                      dsn: ${MYSQL_DSN}
                      log-dsn: ${MYSQL_LOG_DSN}
                      log-body-dsn: ${MYSQL_LOG_BODY_DSN}
                      log-sharding:
                        enable: false
                        mode: y

                    redis:
                      dsn: ${REDIS_URI}
                      pool-size: 0
                  permission: null
                  envsubst: true
