This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from karyeet/Dockerfile
Merge Dockerfile into main
- Loading branch information
Showing
8 changed files
with
274 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Build | ||
|
||
# Controls when the workflow will run | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'Dockerfile' | ||
release: | ||
types: | ||
- created | ||
|
||
|
||
jobs: | ||
build-matrix: | ||
strategy: | ||
matrix: | ||
os: [buildjet-2vcpu-ubuntu-2204-arm, ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# Get the repository's code | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# https://github.com/docker/setup-buildx-action | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Docker Hub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Cache NPM | ||
uses: buildjet/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: npm | ||
|
||
- name: Determine Platform | ||
run: | | ||
if [[ "${{ runner.arch }}" == "X64" ]]; then | ||
echo "Runner is amd64" | ||
echo "PLATFORM=amd64" >> $GITHUB_ENV | ||
elif [[ "${{ runner.arch }}" == "ARM64" ]]; then | ||
echo "Runner is arm64" | ||
echo "PLATFORM=arm64" >> $GITHUB_ENV | ||
fi | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: linux/${{ env.PLATFORM }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: karyeet/mandarine:${{ env.PLATFORM }}-${{ github.ref_name }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
build-docker-multiarch: | ||
runs-on: ubuntu-latest | ||
needs: [build-matrix] | ||
steps: | ||
- name: Login to Docker Hub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Create and push multiarch image | ||
run: | | ||
docker buildx imagetools create -t karyeet/mandarine:${GITHUB_REF_NAME} \ | ||
karyeet/mandarine:arm64-${GITHUB_REF_NAME} \ | ||
karyeet/mandarine:amd64-${GITHUB_REF_NAME} | ||
- name: Push to latest | ||
if: github.event_name == 'release' | ||
run: | | ||
echo "Pushing to latest tag" | ||
docker buildx imagetools create -t karyeet/mandarine:latest \ | ||
karyeet/mandarine:arm64-${GITHUB_REF_NAME} \ | ||
karyeet/mandarine:amd64-${GITHUB_REF_NAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require("play-dl").authorization(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
"downloadLocation": "music", | ||
"tracknameTemplate": "%artist% - %title%", | ||
"albumTracknameTemplate": "%tracknumber% - %title%", | ||
"playlistTracknameTemplate": "%position% - %artist% - %title%", | ||
"createPlaylistFolder": true, | ||
"playlistNameTemplate": "%playlist%", | ||
"createArtistFolder": false, | ||
"artistNameTemplate": "%artist%", | ||
"createAlbumFolder": true, | ||
"albumNameTemplate": "%artist% - %album%", | ||
"createCDFolder": true, | ||
"createStructurePlaylist": false, | ||
"createSingleFolder": false, | ||
"padTracks": true, | ||
"paddingSize": "0", | ||
"illegalCharacterReplacer": "_", | ||
"queueConcurrency": 3, | ||
"maxBitrate": "1", | ||
"feelingLucky": false, | ||
"fallbackBitrate": true, | ||
"fallbackSearch": false, | ||
"fallbackISRC": false, | ||
"logErrors": false, | ||
"logSearched": false, | ||
"overwriteFile": "n", | ||
"createM3U8File": false, | ||
"playlistFilenameTemplate": "playlist", | ||
"syncedLyrics": false, | ||
"embeddedArtworkSize": 800, | ||
"embeddedArtworkPNG": false, | ||
"localArtworkSize": 1400, | ||
"localArtworkFormat": "jpg", | ||
"saveArtwork": false, | ||
"coverImageTemplate": "cover", | ||
"saveArtworkArtist": false, | ||
"artistImageTemplate": "folder", | ||
"jpegImageQuality": 90, | ||
"dateFormat": "Y-M-D", | ||
"albumVariousArtists": true, | ||
"removeAlbumVersion": false, | ||
"removeDuplicateArtists": true, | ||
"featuredToTitle": "0", | ||
"titleCasing": "nothing", | ||
"artistCasing": "nothing", | ||
"executeCommand": "", | ||
"tags": { | ||
"title": true, | ||
"artist": true, | ||
"artists": true, | ||
"album": true, | ||
"cover": true, | ||
"trackNumber": true, | ||
"trackTotal": false, | ||
"discNumber": true, | ||
"discTotal": false, | ||
"albumArtist": true, | ||
"genre": true, | ||
"year": true, | ||
"date": true, | ||
"explicit": true, | ||
"isrc": true, | ||
"length": true, | ||
"barcode": true, | ||
"bpm": true, | ||
"replayGain": false, | ||
"label": true, | ||
"lyrics": false, | ||
"syncedLyrics": false, | ||
"copyright": false, | ||
"composer": false, | ||
"involvedPeople": false, | ||
"source": false, | ||
"rating": false, | ||
"savePlaylistAsCompilation": false, | ||
"useNullSeparator": false, | ||
"saveID3v1": true, | ||
"multiArtistSeparator": "default", | ||
"singleAlbumArtist": false, | ||
"coverDescriptionUTF8": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
#run authorize() for play-dl | ||
# sudo docker run -it --rm -v "./playdlData:/.data" karyeet/mandarine:latest /bin/ash -c "node /Mandarine/Docker/authorize.js" | ||
|
||
version: "3" | ||
|
||
services: | ||
mandarine: | ||
container_name: mandarine_music_bot | ||
image: karyeet/mandarine:latest | ||
volumes: | ||
- ./config/config.json:/Mandarine/config.json:ro | ||
- ./config/models/:/Mandarine/voice/models:ro | ||
- ./mandarineFiles:/root/mandarineFiles | ||
- ./playdlData:/.data | ||
environment: | ||
- "arl=5a2e" | ||
- "runIndexer=True" | ||
restart: unless-stopped | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM --platform=$BUILDPLATFORM node:16-alpine | ||
|
||
LABEL maintainer="https://github.com/karyeet" | ||
|
||
COPY . /Mandarine/ | ||
|
||
RUN apk add python3\ | ||
&& apk add --no-cache --virtual .gyp \ | ||
make \ | ||
g++ \ | ||
py3-pip\ | ||
&& npm install --prefix Mandarine \ | ||
&& python3 -m pip install deemix\ | ||
&& apk del .gyp | ||
|
||
RUN mkdir ~/config \ | ||
&& mv /Mandarine/Docker/deezerConfig.json ~/config/config.json \ | ||
&& touch ~/config/.arl | ||
|
||
CMD echo $arl >> ~/config/.arl \ | ||
&& npm start --prefix Mandarine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters