diff --git a/Dockerfile b/Dockerfile index 6264d80..87e06aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,10 +8,9 @@ WORKDIR /app COPY requirements.txt . # 安装项目依赖 -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple # 复制项目代码到容器内的 /app 目录 -COPY . . # 设置环境变量,指定端口号和主模块 ENV PORT=8000 @@ -20,5 +19,5 @@ ENV MODULE_NAME=my_fastapi_app.main:app # 暴露指定的端口 EXPOSE $PORT -# 启动 FastAPI 应用 -CMD python main.py +## 启动 FastAPI 应用 +#CMD python main.py diff --git a/docker-compose.yml b/docker-compose.yml index e474cec..13a9043 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,16 @@ -version: "3" +version: '3' services: - fastapi-app: - build: - context: . - dockerfile: Dockerfile + build: + context: . + dockerfile: Dockerfile + volumes: + - ../daily:/home/daily ports: - - "8000:8000" \ No newline at end of file + - "8001:8082" + networks: + - app + command: + cd /home/video_search && python3 main.py' +networks: + app: + driver: bridge \ No newline at end of file