From a09012f7afc92d46d6d8c8b0718863faccd7bee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AF=B4=E5=95=A5=E5=91=A2?= Date: Wed, 22 Nov 2023 16:54:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0docker=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 14 ++++++++++++++ docker-compose.yml | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5c39c94 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# 设置基础镜像 +FROM python:3.9 + +# 设置工作目录 +WORKDIR /app + +# 复制项目文件到工作目录 +COPY . /app + +# 安装依赖 +RUN pip install --no-cache-dir -r requirements.txt + +# 运行应用程序 +CMD [ "python", "main.py" ] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..925fd95 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '1' +name: 'lx-music' +services: + api: + build: . + restart: always + ports: + - "9763:9763" + volumes: + - .:/app