diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 068c8634..426d04d7 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,9 +13,16 @@ on: jobs: docker: runs-on: ubuntu-latest + name: Build & Push steps: - name: Checkout uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: 'Extract metadata (tags, labels) for Docker' id: meta uses: docker/metadata-action@v4 @@ -27,16 +34,22 @@ jobs: type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} + type=raw,value=latest,enable={{is_default_branch}} + - name: Log in to Docker Hub if: github.event_name != 'pull_request' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: context: . push: ${{ github.event_name != 'pull_request' }} + platforms: > + linux/amd64, + linux/arm64,linux/arm/v7,linux/arm/v6 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index cea56600..2ebde2a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,9 @@ RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY requirements.txt /usr/src/app/ -RUN apk --update-cache add --virtual build-dependencies gcc libc-dev make \ + +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +RUN apk --update-cache --no-cache add --virtual build-dependencies build-base gcc libc-dev make rust cargo git alpine-sdk \ && pip install --no-cache-dir -r requirements.txt \ && apk del build-dependencies diff --git a/requirements.txt b/requirements.txt index 2ba81b7e..13c02a02 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,5 @@ aiofiles==23.1.0 Jinja2==3.1.2 python-multipart==0.0.5 starlette==0.25.0 -uvicorn[standard]==0.20.0 -yt-dlp==2023.2.17 +uvicorn==0.20.0 +yt-dlp==2023.2.17 \ No newline at end of file