Update README.md
Browse files
README.md
CHANGED
|
@@ -6,29 +6,4 @@ colorTo: green
|
|
| 6 |
sdk: docker
|
| 7 |
app_port: 3000 # Corresponds to "3000:3000" in your docker-compose.yml for the new-api service's container port
|
| 8 |
---
|
| 9 |
-
|
| 10 |
-
## New API Deployment on Hugging Face Spaces
|
| 11 |
-
|
| 12 |
-
This Space runs the `new-api` application.
|
| 13 |
-
|
| 14 |
-
**IMPORTANT SETUP REQUIRED:**
|
| 15 |
-
|
| 16 |
-
This application relies on external Redis and MySQL services. You **must** configure these yourself and then set the appropriate connection strings in this Space's "Settings" tab, under "Secrets".
|
| 17 |
-
|
| 18 |
-
1. **Provision External Services:**
|
| 19 |
-
* Create a **Redis** instance (e.g., on Aiven, Upstash, or your preferred cloud provider).
|
| 20 |
-
* Create a **MySQL 8.2+** instance (e.g., on Aiven, PlanetScale, or your preferred cloud provider). Ensure you create a database named `new-api` (or whatever your `SQL_DSN` will point to) and have the root password or a dedicated user/password.
|
| 21 |
-
|
| 22 |
-
2. **Configure Space Secrets:**
|
| 23 |
-
In this Space's "Settings" > "Secrets", add the following:
|
| 24 |
-
* `REDIS_CONN_STRING`: The full connection string for your external Redis.
|
| 25 |
-
* Example: `redis://your-redis-host:your-redis-port` or `redis://user:password@host:port`
|
| 26 |
-
* `SQL_DSN`: The DSN for your external MySQL database.
|
| 27 |
-
* **Crucially, replace `mysql:3306` with your actual external MySQL host and port.**
|
| 28 |
-
* Example: `root:YOUR_MYSQL_ROOT_PASSWORD@your-external-mysql-host:3306/new-api`
|
| 29 |
-
* Ensure the password (`YOUR_MYSQL_ROOT_PASSWORD`) matches the one you set for your external MySQL.
|
| 30 |
-
* `TZ`: (Can be a Variable or Secret) `Asia/Shanghai`
|
| 31 |
-
* `SESSION_SECRET`: (Secret, if you plan to scale or for security) A long random string.
|
| 32 |
-
* `CRYPTO_SECRET`: (Secret, if needed by your configuration) Another long random string.
|
| 33 |
-
|
| 34 |
-
Once the `Dockerfile`, `README.md` are pushed, and the secrets are configured, Hugging Face Spaces will attempt to build and run your `new-api` container.
|
|
|
|
| 6 |
sdk: docker
|
| 7 |
app_port: 3000 # Corresponds to "3000:3000" in your docker-compose.yml for the new-api service's container port
|
| 8 |
---
|
| 9 |
+
# 确保这里没有 persistent_storage 部分
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|