new
This commit is contained in:
14
websocket_server/.dockerignore
Normal file
14
websocket_server/.dockerignore
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
__pycache__
|
||||||
|
*.pyc
|
||||||
|
*.pyo
|
||||||
|
*.pyd
|
||||||
|
.Python
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
.env
|
||||||
|
.DS_Store
|
||||||
|
output_images/
|
||||||
|
*.raw
|
||||||
|
*.mp3
|
||||||
|
generated_thumb.bin
|
||||||
|
test_generated_thumb.bin
|
||||||
1
websocket_server/.env.example
Normal file
1
websocket_server/.env.example
Normal file
@@ -0,0 +1 @@
|
|||||||
|
DASHSCOPE_API_KEY=sk-a294f382488d46a1aa0d7cd8e750729b
|
||||||
28
websocket_server/Dockerfile
Normal file
28
websocket_server/Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
FROM python:3.11-slim
|
||||||
|
|
||||||
|
# 设置工作目录
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# 安装系统依赖
|
||||||
|
# ffmpeg: 用于音频格式转换
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
ffmpeg \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# 复制依赖文件
|
||||||
|
COPY requirements.txt .
|
||||||
|
|
||||||
|
# 安装Python依赖
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# 复制项目文件
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# 创建输出目录
|
||||||
|
RUN mkdir -p output_images
|
||||||
|
|
||||||
|
# 暴露端口
|
||||||
|
EXPOSE 8000
|
||||||
|
|
||||||
|
# 启动命令
|
||||||
|
CMD ["python", "server.py"]
|
||||||
12
websocket_server/docker-compose.yml
Normal file
12
websocket_server/docker-compose.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
websocket-server:
|
||||||
|
build: .
|
||||||
|
container_name: epaper-websocket-server
|
||||||
|
ports:
|
||||||
|
- "8000:8000"
|
||||||
|
volumes:
|
||||||
|
- ./output_images:/app/output_images
|
||||||
|
- ./.env:/app/.env
|
||||||
|
restart: unless-stopped
|
||||||
Reference in New Issue
Block a user