Skip to content

Commit

Permalink
Merge pull request #754 from Guovin/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
Guovin authored Dec 27, 2024
2 parents 731f801 + ab157be commit 73a6bca
Show file tree
Hide file tree
Showing 5 changed files with 453 additions and 460 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Push Docker Images

on:
workflow_dispatch:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: guovern/iptv-api:latest
platforms: linux/amd64,linux/arm64,linux/arm/v7
build-args: |
APP_WORKDIR=/iptv-api
LITE=False
- name: Build and push Docker image (Lite)
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: guovern/iptv-api:lite
platforms: linux/amd64,linux/arm64,linux/arm/v7
build-args: |
APP_WORKDIR=/iptv-api-lite
LITE=True
32 changes: 14 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ WORKDIR /app

COPY Pipfile* ./

RUN pip install -i https://mirrors.aliyun.com/pypi/simple pipenv

RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy\
RUN pip install pipenv \
&& 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 wget tar xz-utils

RUN mkdir /usr/bin-new \
&& ARCH=$(dpkg --print-architecture) \
&& wget -O /tmp/ffmpeg.tar.gz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-${ARCH}-static.tar.xz \
&& tar -xvf /tmp/ffmpeg.tar.gz -C /usr/bin-new/

FROM python:3.13-slim

Expand All @@ -29,21 +34,12 @@ 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 apt-get update && apt-get install -y --no-install-recommends cron ffmpeg

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/*
COPY --from=builder /usr/bin-new/* /usr/bin

RUN apt-get update && apt-get install -y --no-install-recommends cron \
&& 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 && /.venv/bin/python main.py"; \
Expand Down
2 changes: 0 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ pyinstaller = "*"
aiohttp = "*"
flask = "*"
opencc-python-reimplemented = "*"
fake-useragent = "*"
pillow = "*"
m3u8 = "*"

Expand All @@ -35,7 +34,6 @@ async-timeout = "*"
aiohttp = "*"
flask = "*"
opencc-python-reimplemented = "*"
fake-useragent = "*"
gunicorn = "*"
pillow = "*"
m3u8 = "*"
Expand Down
Loading

0 comments on commit 73a6bca

Please sign in to comment.