Add files via upload

This commit is contained in:
XXhaos
2026-04-23 17:25:35 +08:00
committed by GitHub
commit 1978c31bf0
4 changed files with 1602 additions and 0 deletions

12
xbox-bot/Dockerfile Normal file
View File

@@ -0,0 +1,12 @@
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --omit=dev
COPY server.js ./
EXPOSE 3000
CMD ["node", "server.js"]

View File

@@ -0,0 +1,26 @@
services:
bot:
build: .
restart: unless-stopped
ports:
- "3000:3000" # 如果有反向代理nginx/caddy可以去掉这行只留内网
env_file:
- .env
depends_on:
redis:
condition: service_healthy
redis:
image: redis:7-alpine
restart: unless-stopped
volumes:
- redis_data:/data # 数据持久化,重启不丢
command: redis-server --save 60 1 --loglevel warning
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
volumes:
redis_data:

16
xbox-bot/package.json Normal file
View File

@@ -0,0 +1,16 @@
{
"name": "xbox-bot",
"version": "1.0.0",
"type": "module",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"express": "^4.18.2",
"redis": "^4.6.13"
},
"engines": {
"node": ">=18.0.0"
}
}

1548
xbox-bot/server.js Normal file

File diff suppressed because it is too large Load Diff