优化package
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 28s

This commit is contained in:
Song367 2026-03-18 15:22:37 +08:00
parent 7cc8fab931
commit 4031d21dcc
6 changed files with 2720 additions and 111 deletions

View File

@ -20,6 +20,14 @@ MINIMAX_API_KEY="YOUR_MINIMAX_API_KEY"
# Defaults to https://api.minimaxi.com
MINIMAX_API_HOST="https://api.minimaxi.com"
# FFMPEG_PATH: Optional absolute path to ffmpeg binary.
# If omitted, the server resolves ffmpeg from system PATH.
# FFMPEG_PATH="/usr/bin/ffmpeg"
# FFPROBE_PATH: Optional absolute path to ffprobe binary.
# If omitted, the server resolves ffprobe from system PATH.
# FFPROBE_PATH="/usr/bin/ffprobe"
# APP_URL: The URL where this applet is hosted.
# AI Studio automatically injects this at runtime with the Cloud Run service URL.
# Used for self-referential links, OAuth callbacks, and API endpoints.

View File

@ -1,20 +1,20 @@
FROM node:22.14.0-alpine3.21 as build-stage
FROM node:22.14.0-alpine3.21 AS build-stage
COPY ./ /app
WORKDIR /app
ENV YARN_REGISTRY https://registry.npmmirror.com/
RUN yarn install
ENV NPM_CONFIG_REGISTRY=https://registry.npmmirror.com/
RUN npm install
COPY . .
ARG DEPLOY_ENV=prod
RUN if [ "$DEPLOY_ENV" = "test" ]; then \
yarn build ; \
npm run build ; \
else \
yarn build ; \
npm run build ; \
fi
# production stage
FROM nginx:1.27.4-alpine3.21 as production-stage
FROM nginx:1.27.4-alpine3.21 AS production-stage
RUN mkdir /app
COPY --from=build-stage /app/dist /app
COPY nginx.conf /etc/nginx/nginx.conf

View File

@ -10,7 +10,7 @@ View your app in AI Studio: https://ai.studio/apps/a38a3cd5-7f82-49f0-a26e-99be4
## Run Locally
**Prerequisites:** Node.js
**Prerequisites:** Node.js, system `ffmpeg`, and system `ffprobe`
1. Install dependencies:
@ -22,6 +22,8 @@ View your app in AI Studio: https://ai.studio/apps/a38a3cd5-7f82-49f0-a26e-99be4
3. Optional defaults:
`DEFAULT_LLM_PROVIDER=doubao`
`DOUBAO_MODEL=doubao-seed-2-0-pro-260215`
`FFMPEG_PATH=/path/to/ffmpeg` (optional)
`FFPROBE_PATH=/path/to/ffprobe` (optional)
4. Run the app:
`npm run dev`

2788
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -20,8 +20,6 @@
"cors": "^2.8.6",
"dotenv": "^17.3.1",
"express": "^4.22.1",
"ffmpeg-static": "^5.3.0",
"ffprobe-static": "^3.1.0",
"fluent-ffmpeg": "^2.1.3",
"lucide-react": "^0.546.0",
"motion": "^12.23.24",

View File

@ -5,8 +5,6 @@ import { createServer as createViteServer } from 'vite';
import path from 'path';
import fs from 'fs';
import ffmpeg from 'fluent-ffmpeg';
import ffmpegInstaller from 'ffmpeg-static';
import ffprobeInstaller from 'ffprobe-static';
import axios from 'axios';
import multer from 'multer';
import {
@ -36,14 +34,17 @@ if (!fs.existsSync('uploads')) {
fs.mkdirSync('uploads');
}
if (ffmpegInstaller) {
ffmpeg.setFfmpegPath(ffmpegInstaller);
}
if (ffprobeInstaller.path) {
ffmpeg.setFfprobePath(ffprobeInstaller.path);
dotenv.config();
const ffmpegPath = process.env.FFMPEG_PATH?.trim();
if (ffmpegPath) {
ffmpeg.setFfmpegPath(ffmpegPath);
}
dotenv.config();
const ffprobePath = process.env.FFPROBE_PATH?.trim();
if (ffprobePath) {
ffmpeg.setFfprobePath(ffprobePath);
}
async function startServer() {
const app = express();