From a7bf97d1a592046f5398bb64c2bdb175dcb60ef9 Mon Sep 17 00:00:00 2001 From: liaofulong Date: Sat, 2 Dec 2023 09:48:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EDocker=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 11 +++-------- README.md | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5c39c94..9dfaf33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,9 @@ -# 设置基础镜像 -FROM python:3.9 +FROM python:3.10.13-slim-bullseye -# 设置工作目录 WORKDIR /app -# 复制项目文件到工作目录 COPY . /app -# 安装依赖 -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache -r requirements.txt -# 运行应用程序 -CMD [ "python", "main.py" ] +CMD [ "python", "main.py" ] \ No newline at end of file diff --git a/README.md b/README.md index 99aebcd..005f3d4 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ ## 使用此项目导致的封号等情况与开发者无关 -## 部署方法 +## 手动部署方法 环境要求:Python 3.8+ 没有其他限制,能用Python理论上就能跑起来 @@ -34,6 +34,20 @@ python main.py # 启动服务 对于release的部署和上方类似,这里不再赘述 +## Docker部署(目录映射搞不懂,最好有个宝塔面板啥的) + +环境要求:Docker +最低版本要求不知道,最新的bug会少知道这就行 + +```bash +sudo apt-get update +sudo apt-get install -y docker.io +docker run -p 9763:9763 -d ikun0014/lx-music-api-server-python:latest +``` + +配置文件填写需要到容器目录里的/app目录填写config.json +小小白还是回去手动部署得了 + ## 返回码说明 接口返回值中`body.code`字段值中的代码含义