Merge pull request #279 from edward8e/master

Upgrade to include Docker
This commit is contained in:
Izuco 2022-03-13 11:46:47 +01:00 committed by GitHub
commit 1d1ffd324b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 71 additions and 0 deletions

34
.github/workflows/docker.yml vendored Normal file
View file

@ -0,0 +1,34 @@
# This workflow will build a Node project with Docker
name: build and push docker image
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v2.9.0
with:
github-token: ${{ github.token }}
push: ${{ github.ref == 'refs/heads/main' }}
tags: |
"izuco/multi-downloader-nx:latest"
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

37
Dockerfile Normal file
View file

@ -0,0 +1,37 @@
FROM node AS builder
WORKDIR "/app"
COPY . .
# Install 7z for packaging
RUN apt-get update
RUN apt-get install p7zip-full -y
# Update bin-path for docker/linux
RUN echo 'ffmpeg: "./bin/ffmpeg/ffmpeg"\nmkvmerge: "./bin/mkvtoolnix/mkvmerge"' > /app/config/bin-path.yml
#Build AniDL
RUN npm i
RUN npm run build-ubuntu-cli
# Move build to new Clean Image
FROM node
WORKDIR "/app"
COPY --from=builder /app/lib/_builds/multi-downloader-nx-ubuntu64-cli ./
# Install mkvmerge and ffmpeg
RUN mkdir -p /app/bin/mkvtoolnix
RUN mkdir -p /app/bin/ffmpeg
RUN apt-get update
RUN apt-get install mkvtoolnix -y
RUN apt-get install ffmpeg -y
RUN mv /usr/bin/mkvmerge /app/bin/mkvtoolnix/mkvmerge
RUN mv /usr/bin/ffmpeg /app/bin/ffmpeg/ffmpeg
ENTRYPOINT ["tail", "-f", "/dev/null"]