-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
38 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,7 @@ | |
**/.DS_Store | ||
.venv | ||
.git | ||
./target | ||
Cargo.lock | ||
.github | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,35 @@ | ||
#拉取 python3.10 的基础镜像 | ||
FROM python:3.10 | ||
##拉取 python3.10 的基础镜像 | ||
#FROM python:3.10 | ||
# | ||
#WORKDIR /app | ||
# | ||
#COPY . /app | ||
# | ||
#RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \ | ||
# pip install --upgrade pip --no-cache && \ | ||
# pip install --no-cache -r requirements.txt | ||
# | ||
#EXPOSE 80 | ||
# | ||
#CMD ["uvicorn", "main:app", "--host", "127.0.0.1", "--port", "20245", "--workers", "4"] | ||
|
||
FROM python:3.10-slim AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY . /app | ||
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple | ||
|
||
COPY requirements.txt . | ||
RUN pip install --upgrade pip && \ | ||
pip wheel --no-deps --wheel-dir /wheels -r requirements.txt | ||
|
||
FROM python:3.10-slim | ||
|
||
WORKDIR /app | ||
|
||
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \ | ||
pip install --upgrade pip --no-cache && \ | ||
pip install --no-cache -r requirements.txt | ||
COPY --from=builder /wheels /wheels | ||
COPY --from=builder /app/requirements.txt . | ||
|
||
EXPOSE 80 | ||
RUN pip install --no-cache /wheels/* | ||
|
||
CMD ["uvicorn", "main:app", "--host", "127.0.0.1", "--port", "20245", "--workers", "4"] | ||
COPY . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters