From a0e72c7b6fccb75a33b9cc9204fa83696ae64443 Mon Sep 17 00:00:00 2001 From: zx <834688422@qq.com> Date: Sat, 2 Dec 2023 18:12:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9Dockerfile=E9=85=8D=E7=BD=AE,?= =?UTF-8?q?=E4=BB=A5=E5=8F=8Adocker-compose=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 ++- docker-compose.yml | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9dfaf33..76c7b1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ WORKDIR /app COPY . /app -RUN pip install --no-cache -r requirements.txt +# 指定源, 如果后期源挂了, 更换个源就可以. +RUN pip install --no-cache -i https://pypi.mirrors.ustc.edu.cn/simple/ -r requirements.txt CMD [ "python", "main.py" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 925fd95..aff40ff 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,15 @@ -version: '1' -name: 'lx-music' +version: "3.8" services: - api: + lx: + container_name: lx-server build: . - restart: always ports: - "9763:9763" volumes: - .:/app + environment: + TZ: 'Asia/Shanghai' + restart: always +networks: + default: +