{
  "manifest_version": "1.0.0",
  "template": {
    "id": "76cc8717-d206-410e-adee-690b3e181126",
    "slug": "ffmpeg-rest-api",
    "name": "FFmpeg REST API",
    "description": "FFmpeg REST API with S3-compatible Storage Support",
    "url": "https://railway.com/deploy/ffmpeg-rest-api",
    "upstream": {
      "image": "ghcr.io/crisog/ffmpeg-rest-standalone:1.2.0"
    }
  },
  "services": [
    {
      "name": "Redis",
      "source": {
        "image": "redis:7-alpine"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "tcp_ports": [
        6379
      ],
      "http": false
    },
    {
      "name": "FFmpeg REST",
      "source": {
        "image": "ghcr.io/crisog/ffmpeg-rest-standalone:1.2.0"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "REDISHOST",
      "service": "Redis",
      "description": "Provide a value for REDISHOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDISPORT",
      "service": "Redis",
      "description": "Provide a value for REDISPORT.",
      "secret": false,
      "strategy": "default",
      "default": "6379"
    },
    {
      "key": "REDISUSER",
      "service": "Redis",
      "description": "Provide a value for REDISUSER.",
      "secret": false,
      "strategy": "default",
      "default": "default"
    },
    {
      "key": "REDIS_URL",
      "service": "Redis",
      "description": "Connection string for connecting to redis using the private network",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDISPASSWORD",
      "service": "Redis",
      "description": "Provide a value for REDISPASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Provide a value for REDIS_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "REDIS_PUBLIC_URL",
      "service": "Redis",
      "description": "Connection string for connecting to redis externally",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PORT",
      "service": "FFmpeg REST",
      "description": "Provide a value for PORT.",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "NODE_ENV",
      "service": "FFmpeg REST",
      "description": "Provide a value for NODE_ENV.",
      "secret": false,
      "strategy": "default",
      "default": "production"
    },
    {
      "key": "TEMP_DIR",
      "service": "FFmpeg REST",
      "description": "Provide a value for TEMP_DIR.",
      "secret": false,
      "strategy": "default",
      "default": "/tmp/ffmpeg-rest"
    },
    {
      "key": "CACHE_DIR",
      "service": "FFmpeg REST",
      "description": "Cache directory (defaults to <TEMP_DIR>/cache)",
      "secret": false,
      "strategy": "default",
      "default": "/tmp/ffmpeg-rest/cache"
    },
    {
      "key": "REDIS_URL",
      "service": "FFmpeg REST",
      "description": "Provide a value for REDIS_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "AUTH_TOKEN",
      "service": "FFmpeg REST",
      "description": "Provide a value for AUTH_TOKEN.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "STORAGE_MODE",
      "service": "FFmpeg REST",
      "description": "Set to `s3` if you want to enable S3 mode. You'll need to configure S3 variables.",
      "secret": false,
      "strategy": "default",
      "default": "stateless"
    },
    {
      "key": "CACHE_ENABLED",
      "service": "FFmpeg REST",
      "description": "Enable/disable stateless binary cache",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "MAX_FILE_SIZE",
      "service": "FFmpeg REST",
      "description": "Provide a value for MAX_FILE_SIZE.",
      "secret": false,
      "strategy": "default",
      "default": "104857600"
    },
    {
      "key": "CACHE_TTL_HOURS",
      "service": "FFmpeg REST",
      "description": "Entry TTL in hours (90 days)",
      "secret": false,
      "strategy": "default",
      "default": "2160"
    },
    {
      "key": "S3_DEDUP_ENABLED",
      "service": "FFmpeg REST",
      "description": "Provide a value for S3_DEDUP_ENABLED.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "CACHE_MAX_SIZE_MB",
      "service": "FFmpeg REST",
      "description": "Max cache size on disk in MiB (1 GiB)",
      "secret": false,
      "strategy": "default",
      "default": "1024"
    },
    {
      "key": "S3_DEDUP_TTL_DAYS",
      "service": "FFmpeg REST",
      "description": "Provide a value for S3_DEDUP_TTL_DAYS.",
      "secret": false,
      "strategy": "default",
      "default": "90"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "ffmpeg-rest-api"
      }
    },
    "cli": "railway deploy --template ffmpeg-rest-api",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "76cc8717-d206-410e-adee-690b3e181126",
            "serializedConfig": {
              "services": {
                "0b194aa4-20ba-4e4a-add6-90c0bd821f07": {
                  "icon": "https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg",
                  "name": "Redis",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH\""
                  },
                  "source": {
                    "image": "redis:7-alpine"
                  },
                  "variables": {
                    "REDISHOST": {
                      "isOptional": false,
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDISPORT": {
                      "isOptional": false,
                      "defaultValue": "6379"
                    },
                    "REDISUSER": {
                      "isOptional": false,
                      "defaultValue": "default"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Connection string for connecting to redis using the private network",
                      "defaultValue": "redis://${{ REDISUSER }}:${{ REDIS_PASSWORD }}@${{ REDISHOST }}:${{ REDISPORT }}"
                    },
                    "REDISPASSWORD": {
                      "isOptional": false,
                      "defaultValue": "${{REDIS_PASSWORD}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    },
                    "REDIS_PUBLIC_URL": {
                      "description": "Connection string for connecting to redis externally",
                      "defaultValue": "redis://default:${{ REDIS_PASSWORD }}@${{ RAILWAY_TCP_PROXY_DOMAIN }}:${{ RAILWAY_TCP_PROXY_PORT }}"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "6379": {}
                    }
                  },
                  "volumeMounts": {
                    "0b194aa4-20ba-4e4a-add6-90c0bd821f07": {
                      "mountPath": "/data"
                    }
                  },
                  "haTemplateCode": "redis-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxies",
                      "options": [
                        1,
                        2
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "HAProxy instances routing writes to the primary",
                      "defaultValue": 2
                    },
                    "replica": {
                      "label": "Redis Replicas",
                      "options": [
                        2,
                        3,
                        4,
                        5
                      ],
                      "nodeLabel": "Redis",
                      "description": "Nodes running Redis + colocated Sentinel",
                      "defaultValue": 2
                    },
                    "internal": null,
                    "description": "This will convert your Redis instance to an HA cluster with Sentinel failover and HAProxy routing to the primary."
                  }
                },
                "14178b1a-7cd3-443f-b2bf-30bdae4e5e6b": {
                  "icon": "https://devicons.railway.app/Hono",
                  "name": "FFmpeg REST",
                  "source": {
                    "image": "ghcr.io/crisog/ffmpeg-rest-standalone:1.2.0"
                  },
                  "variables": {
                    "PORT": {
                      "defaultValue": "3000"
                    },
                    "NODE_ENV": {
                      "defaultValue": "production"
                    },
                    "TEMP_DIR": {
                      "defaultValue": "/tmp/ffmpeg-rest"
                    },
                    "CACHE_DIR": {
                      "isOptional": true,
                      "description": "Cache directory (defaults to <TEMP_DIR>/cache)",
                      "defaultValue": "/tmp/ffmpeg-rest/cache"
                    },
                    "REDIS_URL": {
                      "defaultValue": "${{Redis.REDIS_URL}}"
                    },
                    "S3_BUCKET": {
                      "isOptional": true,
                      "defaultValue": ""
                    },
                    "S3_REGION": {
                      "isOptional": true,
                      "defaultValue": ""
                    },
                    "AUTH_TOKEN": {
                      "isOptional": false,
                      "defaultValue": "{{AUTH_TOKEN}}"
                    },
                    "S3_ENDPOINT": {
                      "isOptional": true,
                      "defaultValue": ""
                    },
                    "STORAGE_MODE": {
                      "isOptional": false,
                      "description": "Set to `s3` if you want to enable S3 mode. You'll need to configure S3 variables.",
                      "defaultValue": "stateless"
                    },
                    "CACHE_ENABLED": {
                      "isOptional": true,
                      "description": "Enable/disable stateless binary cache",
                      "defaultValue": "true"
                    },
                    "MAX_FILE_SIZE": {
                      "defaultValue": "104857600"
                    },
                    "S3_PUBLIC_URL": {
                      "isOptional": true,
                      "description": "Publicly accessible URL to the S3 bucket",
                      "defaultValue": ""
                    },
                    "S3_PATH_PREFIX": {
                      "isOptional": true,
                      "description": "Subdirectory where files will be stored within the bucket",
                      "defaultValue": ""
                    },
                    "CACHE_TTL_HOURS": {
                      "isOptional": true,
                      "description": "Entry TTL in hours (90 days)",
                      "defaultValue": "2160"
                    },
                    "S3_ACCESS_KEY_ID": {
                      "isOptional": true,
                      "defaultValue": ""
                    },
                    "S3_DEDUP_ENABLED": {
                      "isOptional": true,
                      "defaultValue": "true"
                    },
                    "CACHE_MAX_SIZE_MB": {
                      "isOptional": true,
                      "description": "Max cache size on disk in MiB (1 GiB)",
                      "defaultValue": "1024"
                    },
                    "S3_DEDUP_TTL_DAYS": {
                      "isOptional": true,
                      "defaultValue": "90"
                    },
                    "S3_SECRET_ACCESS_KEY": {
                      "isOptional": true,
                      "defaultValue": ""
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:3000": {
                        "port": 3000
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-11T22:14:37.124Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-12T00:59:54.657Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_18a14f3919d44c0e92af",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 86,
    "typical_build_seconds": 0,
    "typical_start_seconds": 20,
    "slowest_service": "FFmpeg REST"
  }
}
