feat: docker本地调试:
- 1. import不同系统语法不一致 - 2. mysql允许远程访问
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# 1、从官方 Python 基础镜像开始
|
||||
FROM python:3.9
|
||||
FROM python:3.10
|
||||
|
||||
# 2、将当前工作目录设置为 /code
|
||||
# 这是放置 requirements.txt 文件和应用程序目录的地方
|
||||
@@ -13,7 +13,7 @@ COPY ./requirements.txt /code/requirements.txt
|
||||
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
||||
|
||||
# 5、复制 FastAPI 项目代码
|
||||
COPY ./app /code/app
|
||||
COPY ./cloudcontainers/app /code/app
|
||||
|
||||
# 6、运行服务
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
|
||||
CMD ["uvicorn", "cloudcontainers.app.main:app", "--host", "0.0.0.0", "--port", "80"]
|
||||
Reference in New Issue
Block a user