generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: 使用 uv 管理项目 * style: 使用 ruff 0.7.0 格式化代码 * ci: 使用 setup-uv * build: 调整 docker 写法 * ci: 默认进行 Docker 镜像编译
- Loading branch information
Showing
15 changed files
with
1,418 additions
and
1,884 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
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
3.12.7 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,21 @@ | ||
FROM python:3.12 as requirements-stage | ||
|
||
WORKDIR /tmp | ||
|
||
COPY ./pyproject.toml ./poetry.lock* /tmp/ | ||
|
||
RUN curl -sSL https://install.python-poetry.org -o install-poetry.py | ||
|
||
RUN python install-poetry.py --yes | ||
|
||
ENV PATH="${PATH}:/root/.local/bin" | ||
|
||
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes | ||
|
||
FROM python:3.12-slim-bullseye | ||
FROM python:3.12.4-slim | ||
COPY --from=ghcr.io/astral-sh/uv:0.4.25 /uv /bin/uv | ||
|
||
# 设置时区 | ||
ENV TZ=Asia/Shanghai | ||
|
||
# 安装依赖 | ||
COPY --from=requirements-stage /tmp/requirements.txt /app/requirements.txt | ||
RUN apt-get update \ | ||
&& apt-get -y upgrade \ | ||
&& apt-get install -y --no-install-recommends git \ | ||
&& pip install --no-cache-dir --upgrade -r /app/requirements.txt \ | ||
&& apt-get purge -y --auto-remove \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm /app/requirements.txt | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Python 依赖 | ||
COPY pyproject.toml uv.lock ./ | ||
RUN uv sync --no-dev --frozen --compile-bytecode | ||
|
||
COPY bot.py .env /app/ | ||
COPY src /app/src/ | ||
|
||
CMD ["python", "/app/bot.py"] | ||
CMD ["uv", "run", "--no-dev", "/app/bot.py"] |
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
Oops, something went wrong.