Spaces:
Running
Running
liuzhao521
commited on
Commit
·
bcd4897
1
Parent(s):
3ed6209
Add Hugging Face Spaces support with Dockerfile
Browse files- Dockerfile +29 -0
- README.md +10 -0
- src/config/config.js +1 -1
Dockerfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:20-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# 复制项目文件
|
| 6 |
+
COPY package*.json ./
|
| 7 |
+
COPY client/package*.json ./client/
|
| 8 |
+
|
| 9 |
+
# 安装依赖
|
| 10 |
+
RUN npm install
|
| 11 |
+
|
| 12 |
+
# 复制源代码
|
| 13 |
+
COPY . .
|
| 14 |
+
|
| 15 |
+
# 构建前端
|
| 16 |
+
RUN npm run build
|
| 17 |
+
|
| 18 |
+
# 创建数据目录
|
| 19 |
+
RUN mkdir -p data
|
| 20 |
+
|
| 21 |
+
# 暴露端口 (Hugging Face Spaces 使用 7860)
|
| 22 |
+
EXPOSE 7860
|
| 23 |
+
|
| 24 |
+
# 设置环境变量
|
| 25 |
+
ENV PORT=7860
|
| 26 |
+
ENV NODE_ENV=production
|
| 27 |
+
|
| 28 |
+
# 启动服务
|
| 29 |
+
CMD ["npm", "start"]
|
README.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Antigravity Gateway
|
| 2 |
|
| 3 |
<div align="center">
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Antigravity2api
|
| 3 |
+
emoji: 🚀
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
license: mit
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
# Antigravity Gateway
|
| 12 |
|
| 13 |
<div align="center">
|
src/config/config.js
CHANGED
|
@@ -2,7 +2,7 @@ import fs from 'fs';
|
|
| 2 |
import log from '../utils/logger.js';
|
| 3 |
|
| 4 |
const defaultConfig = {
|
| 5 |
-
server: { port: 8045, host: '
|
| 6 |
api: {
|
| 7 |
url: 'https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:streamGenerateContent?alt=sse',
|
| 8 |
modelsUrl: 'https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:fetchAvailableModels',
|
|
|
|
| 2 |
import log from '../utils/logger.js';
|
| 3 |
|
| 4 |
const defaultConfig = {
|
| 5 |
+
server: { port: parseInt(process.env.PORT) || 8045, host: '0.0.0.0' },
|
| 6 |
api: {
|
| 7 |
url: 'https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:streamGenerateContent?alt=sse',
|
| 8 |
modelsUrl: 'https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:fetchAvailableModels',
|