-
Notifications
You must be signed in to change notification settings - Fork 58
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
1 changed file
with
17 additions
and
5 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 |
---|---|---|
@@ -1,29 +1,41 @@ | ||
FROM python:3.11.7-alpine3.19 | ||
FROM python:3.11.7-alpine3.19 as base | ||
|
||
WORKDIR /app | ||
|
||
ENV LANG=zh_CN.UTF-8 \ | ||
TZ=Asia/Shanghai \ | ||
BILI_IN_DOCKER=true | ||
|
||
COPY poetry.lock pyproject.toml ./ | ||
|
||
RUN apk add --no-cache ffmpeg tini \ | ||
&& apk add --no-cache --virtual .build-deps \ | ||
gcc \ | ||
musl-dev \ | ||
libffi-dev \ | ||
openssl-dev \ | ||
&& pip install poetry \ | ||
&& poetry config virtualenvs.create false \ | ||
&& pip install poetry==1.7.1 pip3-autoremove==1.2.0 | ||
|
||
COPY poetry.lock pyproject.toml ./ | ||
|
||
RUN poetry config virtualenvs.create false \ | ||
&& poetry install --only main --no-root \ | ||
&& pip3-autoremove -y poetry pip3-autoremove \ | ||
&& apk del .build-deps \ | ||
&& rm -rf \ | ||
/root/.cache \ | ||
/tmp/* | ||
|
||
COPY . . | ||
|
||
FROM scratch | ||
|
||
WORKDIR /app | ||
|
||
ENV LANG=zh_CN.UTF-8 \ | ||
TZ=Asia/Shanghai \ | ||
BILI_IN_DOCKER=true | ||
|
||
COPY --from=base / / | ||
|
||
ENTRYPOINT [ "tini", "python", "entry.py" ] | ||
|
||
VOLUME [ "/app/config", "/app/data", "/app/thumb", "/Videos/Bilibilis" ] |