chore: Optimization docker (#17)

* feat: docker build adds cache

* fix: dockerfile optimization

* doc: dockerhub pictures are not displayed properly

---------

Co-authored-by: DDSRem <1448139087@qq.com>
This commit is contained in:
DDSDerek
2024-01-04 20:51:03 +08:00
committed by GitHub
parent 8ea2fbe0f9
commit 6cbacbd127
4 changed files with 23 additions and 12 deletions

View File

@@ -43,4 +43,6 @@ jobs:
linux/arm64/v8 linux/arm64/v8
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}

View File

@@ -45,6 +45,8 @@ jobs:
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
- -
name: Update DockerHub description name: Update DockerHub description
uses: peter-evans/dockerhub-description@v3 uses: peter-evans/dockerhub-description@v3

View File

@@ -1,22 +1,29 @@
FROM python:3.11.6-alpine3.18 AS base FROM python:3.11.6-alpine3.19
WORKDIR /app WORKDIR /app
ENV BILI_IN_DOCKER=true ENV LANG=zh_CN.UTF-8 \
TZ=Asia/Shanghai \
BILI_IN_DOCKER=true
COPY poetry.lock pyproject.toml ./ COPY poetry.lock pyproject.toml ./
RUN apk add ffmpeg \ RUN apk add --no-cache ffmpeg tini \
&& apk add --no-cache --virtual .build-deps \ && apk add --no-cache --virtual .build-deps \
gcc \ gcc \
musl-dev \ musl-dev \
libffi-dev \ libffi-dev \
openssl-dev \ openssl-dev \
&& pip install poetry \ && pip install poetry \
&& poetry config virtualenvs.create false \ && poetry config virtualenvs.create false \
&& poetry install --no-dev --no-interaction --no-ansi \ && poetry install --no-dev --no-interaction --no-ansi \
&& apk del .build-deps && apk del .build-deps \
&& rm -rf \
/root/.cache \
/tmp/*
COPY . . COPY . .
ENTRYPOINT [ "python", "entry.py" ] ENTRYPOINT [ "tini", "python", "entry.py" ]
VOLUME [ "/app/config", "/app/data", "/app/thumb", "/Videos/Bilibilis" ]

View File

@@ -13,9 +13,9 @@
## 工作截图 ## 工作截图
![下载视频](asset/run.png) ![下载视频](https://raw.githubusercontent.com/amtoaer/bili-sync/main/asset/run.png)
![EMBY 识别](asset/emby.png) ![EMBY 识别](https://raw.githubusercontent.com/amtoaer/bili-sync/main/asset/emby.png)
## 配置文件 ## 配置文件