PerformanC / NodeLink

Performant LavaLink alternative written with Node.Js
BSD 2-Clause "Simplified" License
38 stars 23 forks source link

Docker image #45

Closed HighError closed 5 months ago

HighError commented 5 months ago

Changes

Why

Docker is one of the convenient startup options

Checkmarks

Additional information

The image will be automatically created with [app version in package.json] and latest tags. This logic can be modified in .github/workflows

Automatic creation can be disabled by deleting this folder/file In order to automatically publish the image to DockerHub, you need to add two variables. image DOCKERHUB_TOKEN - Access token from DockerHub image

DOCKERHUB_USERNAME - Your Username in DockerHub: image

It is recommended to add these variables before merge so that the image can be published after merge

UnschooledGamer commented 5 months ago

Looks Good but the branch filter should be a wildcard/main branch as the master branch doesn't exist in this repo for CI.

Thanks, UG.

UnschooledGamer commented 5 months ago

Just a question popped in my head. Wouldn't the CI(gh actions) publish the docker image under latest tag even if it's just a pull_request.

HighError commented 5 months ago

Just a question popped in my head. Wouldn't the CI(gh actions) publish the docker image under latest tag even if it's just a pull_request.

Yes, it works with push and pull_request

I copied my settings, just for example. They can be easily edited as desired

Example how it works: https://github.com/Eviloma/evilbot/actions

UnschooledGamer commented 5 months ago

Just a question popped in my head. Wouldn't the CI(gh actions) publish the docker image under latest tag even if it's just a pull_request.

Yes, it works with push and pull_request

I copied my settings, just for example. They can be easily edited as desired

Example: https://github.com/Eviloma/evilbot/actions

Oh alright I knew that I asked cause it's weird to publish a Pull Request in latest/normal release, Still Nvm let @ThePedroo look into it.

Secondly I want to ask is EXPOSE needed for this docker image? It could be helpful I don't know much about Docker. So Don't mind it.

HighError commented 5 months ago

Just a question popped in my head. Wouldn't the CI(gh actions) publish the docker image under latest tag even if it's just a pull_request.

Yes, it works with push and pull_request I copied my settings, just for example. They can be easily edited as desired Example: https://github.com/Eviloma/evilbot/actions

Oh alright I knew that I asked cause it's weird to publish a Pull Request in latest/normal release, Still Nvm let @ThePedroo look into it.

Secondly I want to ask is EXPOSE needed for this docker image? It could be helpful I don't know much about Docker. So Don't mind it.

It depends more on the rules of maintaining a git repository. Sometimes the latest tag is used as an alpha/beta channel for all new commits. Sometimes for the latest stable versions. In my usage, I only add stable code to the main/master branch, so my latest is the latest stable version

I didn't add the port, because at startup the user can change the port and open it with -p 2333:2333 for example. Although I could be wrong.

UnschooledGamer commented 5 months ago

Just a question popped in my head. Wouldn't the CI(gh actions) publish the docker image under latest tag even if it's just a pull_request.

Yes, it works with push and pull_request I copied my settings, just for example. They can be easily edited as desired Example: https://github.com/Eviloma/evilbot/actions

Oh alright I knew that I asked cause it's weird to publish a Pull Request in latest/normal release, Still Nvm let @ThePedroo look into it.

Secondly I want to ask is EXPOSE needed for this docker image? It could be helpful I don't know much about Docker. So Don't mind it.

It depends more on the rules of maintaining a git repository. Sometimes the latest tag is used as an alpha/beta channel for all new commits. Sometimes for the latest stable versions. In my usage, I only add stable code to the main/master branch, so my latest is the latest stable version

True, but mostly if there is a PR(pull request) it won't be published in the stable/latest release cause the Pull Request may not have the correct/functional code, Or the author/reviewers of the repo might want to just test it so they avoid it under stable/latest.

I didn't add the port, because at startup the user can change the port and open it with -p 2333:2333 for example. Although I could be wrong.

🤔 maybe, The docs(the link mentioned previously) says:

Regardless of the EXPOSE settings, you can override them at runtime by using the -p flag.

I'll leave this conversion here else it will continue bigger. Lets wait for Pedroo to Review it.

Thanks, UG.

UnschooledGamer commented 5 months ago

I'm back again after chatting with Pedroo (he'll check after getting free/while having more time)

I forgot to notice that the docker File should have ffmpeg for nodeLink to run properly.

So Please Add it, I'm linking My example dockerFile for ease.

Example Docker File

Thanks, UG.

HighError commented 5 months ago

I tested and the websocket is started via docker. Unfortunately, I can't do more tests yet, since the PC from which I'm sitting can't work with Docker. I've run build and run tests on DockerPlay but it seems websocket ports aren't being opened there, only http.

UnschooledGamer commented 5 months ago

I tested and the websocket is started via docker. Unfortunately, I can't do more tests yet, since the PC from which I'm sitting can't work with Docker. I've run build and run tests on DockerPlay but it seems websocket ports aren't being opened there, only http.

Oh, no issues I'll try running, Let's test my docker cmd skills

HighError commented 5 months ago

image image

ThePedroo commented 5 months ago

They share a port, so if HTTP works, the WS does too

UnschooledGamer commented 5 months ago

They share a port, so if HTTP works, the WS does too

True, they work.

HighError commented 5 months ago

They share a port, so if HTTP works, the WS does too

I couldn't connect, the Discord bot didn't see a connection to NodeLink, and NodeLink didn't write anything to the console about a connection, if there was one.

UnschooledGamer commented 5 months ago

They share a port, so if HTTP works, the WS does too

I couldn't connect, the Discord bot didn't see a connection to NodeLink, and NodeLink didn't write anything to the console about a connection, if there was one.

it worked for me.

Pedroo has asked me to tell you to join PerformanC discord server.