-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # README_en.md
- Loading branch information
Showing
34 changed files
with
1,995 additions
and
955 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,2 +1,2 @@ | ||
*.sh linguist-language=Python | ||
Dockerfile linguist-language=Python | ||
Dockerfile linguist-language=Python |
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 |
---|---|---|
@@ -1,51 +1,58 @@ | ||
FROM python:3.8-slim | ||
FROM python:3.13 AS builder | ||
|
||
ARG APP_WORKDIR=/tv | ||
ARG LITE=False | ||
|
||
ENV APP_WORKDIR=$APP_WORKDIR | ||
WORKDIR /app | ||
|
||
COPY . $APP_WORKDIR | ||
COPY Pipfile* ./ | ||
|
||
WORKDIR $APP_WORKDIR | ||
RUN pip install -i https://mirrors.aliyun.com/pypi/simple pipenv | ||
|
||
RUN pip install -i https://mirrors.aliyun.com/pypi/simple pipenv \ | ||
&& pipenv install | ||
|
||
RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware\n \ | ||
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware\n \ | ||
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware\n \ | ||
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware\n \ | ||
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware\n \ | ||
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware\n \ | ||
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware\n \ | ||
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware\n \ | ||
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware\n" \ | ||
> /etc/apt/sources.list | ||
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy\ | ||
&& if [ "$LITE" = False ]; then pipenv install selenium; fi | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
cron \ | ||
ffmpeg | ||
|
||
ARG INSTALL_CHROMIUM=false | ||
FROM python:3.13-slim | ||
|
||
ARG APP_WORKDIR=/iptv-api | ||
ARG LITE=False | ||
|
||
ENV APP_WORKDIR=$APP_WORKDIR | ||
ENV LITE=$LITE | ||
ENV PATH="/.venv/bin:$PATH" | ||
|
||
WORKDIR $APP_WORKDIR | ||
|
||
COPY . $APP_WORKDIR | ||
|
||
COPY --from=builder /app/.venv /.venv | ||
|
||
RUN echo "deb https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware\n \ | ||
deb-src https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware\n \ | ||
deb https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware\n \ | ||
deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware\n \ | ||
deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware\n \ | ||
deb https://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmware\n \ | ||
deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmware\n \ | ||
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmware\n \ | ||
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmware\n" \ | ||
> /etc/apt/sources.list | ||
|
||
RUN if [ "$INSTALL_CHROMIUM" = "true" ]; then \ | ||
apt-get install -y --no-install-recommends \ | ||
chromium \ | ||
chromium-driver; \ | ||
fi | ||
RUN apt-get update && apt-get install -y --no-install-recommends cron | ||
|
||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* | ||
RUN if [ "$LITE" = False ]; then apt-get install -y --no-install-recommends chromium chromium-driver; fi \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
RUN (crontab -l ; \ | ||
echo "0 22 * * * cd $APP_WORKDIR && /usr/local/bin/pipenv run python main.py scheduled_task"; \ | ||
echo "0 10 * * * cd $APP_WORKDIR && /usr/local/bin/pipenv run python main.py scheduled_task") | crontab - | ||
echo "0 22 * * * cd $APP_WORKDIR && /.venv/bin/python main.py"; \ | ||
echo "0 10 * * * cd $APP_WORKDIR && /.venv/bin/python main.py") | crontab - | ||
|
||
EXPOSE 8000 | ||
|
||
COPY entrypoint.sh /tv_entrypoint.sh | ||
COPY entrypoint.sh /iptv-api-entrypoint.sh | ||
|
||
COPY config /tv_config | ||
COPY config /iptv-api-config | ||
|
||
RUN chmod +x /tv_entrypoint.sh | ||
RUN chmod +x /iptv-api-entrypoint.sh | ||
|
||
ENTRYPOINT /tv_entrypoint.sh | ||
ENTRYPOINT /iptv-api-entrypoint.sh |
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.