diff --git a/.github/workflows/docker-build-nightly.yml b/.github/workflows/docker-build-nightly.yml new file mode 100644 index 0000000..884eb62 --- /dev/null +++ b/.github/workflows/docker-build-nightly.yml @@ -0,0 +1,48 @@ +name: Build EmbyChineseNameSynchronous Nightly + +on: + schedule: + - cron: '0 2 * * *' + +jobs: + push: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@master + + - name: Set Version + id: set-version + run: | + echo "::set-output name=version::${GITHUB_REF:10}" + echo "ReleaseTag=${GITHUB_REF:10}" + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - + name: Build EmbyChineseNameSynchronous + uses: docker/build-push-action@v3 + with: + context: . + file: Dockerfile + platforms: | + linux/amd64 + linux/arm64 + linux/arm/v7 + linux/arm/v6 + push: true + build-args: | + VERSION=${{ steps.set-version.outputs.version }} + tags: | + ${{ secrets.DOCKER_USERNAME }}/embychinesenamesynchronous:nightly diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..386c61c --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,59 @@ +name: Build EmbyChineseNameSynchronous + +on: + release: + types: [published] + +jobs: + push: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@master + + - name: Set Version + id: set-version + run: | + echo "::set-output name=version::${GITHUB_REF:10}" + echo "ReleaseTag=${GITHUB_REF:10}" + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - + name: Build EmbyChineseNameSynchronous + uses: docker/build-push-action@v3 + with: + context: . + file: Dockerfile + platforms: | + linux/amd64 + linux/arm64 + linux/arm/v7 + linux/arm/v6 + push: true + build-args: | + VERSION=${{ steps.set-version.outputs.version }} + tags: | + ${{ secrets.DOCKER_USERNAME }}/embychinesenamesynchronous:${{ steps.set-version.outputs.version }} + ${{ secrets.DOCKER_USERNAME }}/embychinesenamesynchronous:latest + + - + name: Docker Hub Description + uses: peter-evans/dockerhub-description@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ddsderek/embychinesenamesynchronous + short-description: EmbyChineseNameSynchronous Image + readme-filepath: ./README_DOCKER.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..22c731b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM alpine:3.16 + +ENV EMBYHOST=embyhost \ + EMBYUSERID=embyuserid \ + EMBYKEY=embykey \ + TMDBKEY=tmdbkey \ + THREADNUM=16 \ + UPDATEPEOPLE=True \ + UPDATETIME=1 \ + TZ=Asia/Shanghai + +RUN apk add --update --no-cache \ + python3-dev \ + py3-pip \ + bash \ + tzdata && \ + pip install zhconv && \ + pip install requests && \ + pip install simplejson && \ + # 清理 + rm -rf /tmp/* /root/.cache /var/cache/apk/* + +COPY --chmod=755 . /opt + +CMD [ "/opt/start.sh" ] \ No newline at end of file diff --git a/README_DOCKER.md b/README_DOCKER.md new file mode 100644 index 0000000..5c38644 --- /dev/null +++ b/README_DOCKER.md @@ -0,0 +1,37 @@ +**docker-cli** + +``` +docker run -itd \ + --name EmbyChineseNameSynchronous \ + -v ./logs:/opt/logs \ + -e EMBYHOST=embyhost \ + -e EMBYUSERID=embyuserid \ + -e EMBYKEY=embykey \ + -e TMDBKEY=tmdbkey \ + -e THREADNUM=16 \ + -e UPDATEPEOPLE=True \ + -e UPDATETIME=1 \ + -e TZ=Asia/Shanghai \ + ddsderek/embychinesenamesynchronous:latest +``` + +**docker-compose** + +``` +version: '3.3' +services: + embychinesenamesynchronous: + container_name: EmbyChineseNameSynchronous + volumes: + - './logs:/opt/logs' + environment: + - EMBYHOST=embyhost + - EMBYUSERID=embyuserid + - EMBYKEY=embykey + - TMDBKEY=tmdbkey + - THREADNUM=16 + - UPDATEPEOPLE=True + - UPDATETIME=1 + - TZ=Asia/Shanghai + image: 'ddsderek/embychinesenamesynchronous:latest' +``` \ No newline at end of file diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..946e4c7 --- /dev/null +++ b/start.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +function setting { + +touch /setting.lock + +mkdir -p /opt/logs +touch /opt/logs/EmbyChineseNameSynchronous.log + +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime +echo $TZ > /etc/timezone + +cat > /opt/main.py <> /opt/logs/EmbyChineseNameSynchronous.log \ No newline at end of file