Giter Club home page Giter Club logo

docker-ninjam's Introduction

Dockerfile and configs for ninjam server

What is NINJAM server? Please, read this first:

https://www.reddit.com/r/Guitar/comments/butxrs/discussion_online_jamming_everything_you_ever/

This set of configs, scripts and dockerfiles created to start you NINJAM server fast and easy. You can get VPS/VDS Linux server in Hetzner or another hosting provider, install Docker and start you NINJAM server in ~1 hour!

Other repos used in this project

Chat bot for cross-chats communication (by default only between two ninjam servers):

https://github.com/ayvan/ninjam-chatbot

DJ bot for queue management and tracks management:

https://github.com/ayvan/ninjam-dj-bot

DJ bot can manage tracks and playlists: you can upload .mp3 tracks (guitar backing tracks) to DJ bot, and start it using DJ bot chat commands, for example "dj random", or "dj random Am" for random Am backing track. Also it supports playlists.

API documentation for DJ bot:

https://github.com/ayvan/ninjam-dj-bot/tree/master/api

How to start

Get sources:

$ git clone https://github.com/Ayvan/docker-ninjam.git
$ cd docker-ninjam

Generate new passwords:

$ ./passwords.sh

After generating, this script prints passwords to console. Please, save you passwords in secure place.

Set your server hostname and email for Let's Encrypt request:

$ ./hostname.sh YOURSERVER.COM [email protected]

Generate RSA keys for JWT token authentication (for DJ bot API) manually or run script:

$ ./jwt_rsa_keys.sh

RSA keys must be placed in /etc/ninjam directory and file names must be private.pem and public.pem

Create user dj, and user home dir, and tracks dir:

useradd dj && mkdir /home/dj && chown dj:dj /home/dj && mkdir /home/dj/tracks && chown dj:dj /home/dj/tracks

Copy configs and web files (for example, you can use another path to configs, but you need to change it in start command too):

$ sudo cp -R icecast2 /etc/icecast2
$ sudo cp -R ninjam /etc/ninjam
$ sudo cp -R ninjam-web /var/www/ninjam-web

You can edit your configs and web files manually. For example, you can update HTML in index.php file (change favicon.ico, page logo or any text on page), add new users in ninjam2050.cfg and ninjam2051.cfg files etc.

Build docker container:

$ ./build.sh

Start:

$ /usr/bin/docker run -t -a stdout --rm -p 80:80 -p 443:443 -p 2050:2050 -p 2051:2051 -p 8000:8000 -v /home/dj/tracks:/home/dj/tracks -v /etc/ninjam:/etc/ninjam -v /etc/icecast2:/etc/icecast2 -v /var/www/ninjam-web:/app/src/public ninjam-server:latest

To autostart server you can use supervisord config file jam.conf

If you want to connect to the docker container:

First:

$ docker ps

response:

CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS              PORTS                                                                                                          NAMES
f153d46ca7ce        ninjam-server:latest   "/bin/sh -c /etc/rc.…"   4 minutes ago       Up 4 minutes        0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:2050-2051->2050-2051/tcp, 0.0.0.0:8000->8000/tcp, 9000/tcp   xenodochial_heyrovsky

Second: get CONTAINER ID from response above and insert to this command:

$ docker exec -it f153d46ca7ce /bin/bash

How to enable HTTPS?

HTTPS is automatically enabled. Just set your email and domain for Let's Encrypt by hostname.sh script, and it automatically generates certificate for HTTPS.

docker-ninjam's People

Contributors

ayvan avatar meta-meta avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.