mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-07-09 06:23:46 +08:00
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:
4
.github/workflows/docker-image-debug.yml
vendored
4
.github/workflows/docker-image-debug.yml
vendored
@@ -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 }}
|
||||||
2
.github/workflows/docker-image.yml
vendored
2
.github/workflows/docker-image.yml
vendored
@@ -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
|
||||||
|
|||||||
25
Dockerfile
25
Dockerfile
@@ -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" ]
|
||||||
Reference in New Issue
Block a user