Docker (#170)
* added dockerfile * cleanup dockerfile * update Dockerfile and create raspberry dockerfile * doc & aria2
This commit is contained in:
parent
0a4d0aead1
commit
66be67719a
19
Dockerfile
Normal file
19
Dockerfile
Normal file
|
@ -0,0 +1,19 @@
|
|||
FROM alpine:3.3
|
||||
|
||||
ENV GOPATH=/
|
||||
|
||||
RUN apk add --update ca-certificates go ffmpeg make build-base opus-dev python aria2
|
||||
RUN apk upgrade
|
||||
|
||||
RUN wget https://yt-dl.org/downloads/latest/youtube-dl -O /bin/youtube-dl && chmod a+x /bin/youtube-dl
|
||||
|
||||
COPY . /src/github.com/matthieugrieger/mumbledj
|
||||
COPY config.yaml /root/.config/mumbledj/config.yaml
|
||||
|
||||
WORKDIR /src/github.com/matthieugrieger/mumbledj
|
||||
|
||||
RUN make
|
||||
RUN make install
|
||||
RUN apk del go make build-base && rm -rf /var/cache/apk/*
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/mumbledj"]
|
30
README.md
30
README.md
|
@ -13,6 +13,7 @@
|
|||
* [Via `go get`](#via-go-get-recommended)
|
||||
* [Pre-compiled Binaries](#pre-compiled-binaries-easiest)
|
||||
* [From Source](#from-source)
|
||||
* [Docker](#docker)
|
||||
* [Usage](#usage)
|
||||
* [Commands](#commands)
|
||||
* [Contributing](#contributing)
|
||||
|
@ -103,6 +104,35 @@ This will place a compiled `mumbledj` binary in the cloned directory if successf
|
|||
sudo make install
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
You can also use [docker](https://www.docker.com) to run mumbledj.
|
||||
|
||||
First you need to clone the MumbleDJ repository to your machine:
|
||||
```
|
||||
git clone https://github.com/matthieugrieger/mumbledj.git
|
||||
```
|
||||
|
||||
Assuming you have [docker installed](https://www.docker.com/products/docker), you will have to build the image:
|
||||
```
|
||||
docker build -t mumbledj .
|
||||
```
|
||||
|
||||
And then you can run it, passing the configuration through the command line:
|
||||
```
|
||||
docker run --rm --name=mumbledj mumbledj --server=SERVER --api_keys.youtube=YOUR_YOUTUBE_API_KEY --api_keys.soundcloud=YOUR_SOUNDCLOUD_API_KEY
|
||||
```
|
||||
|
||||
In order to run the process as a deamon and restart it automatically on reboot you can use:
|
||||
```
|
||||
docker run -d --restart=unless-stopped --name=mumbledj mumbledj --server=SERVER --api_keys.youtube=YOUR_YOUTUBE_API_KEY --api_keys.soundcloud=YOUR_SOUNDCLOUD_API_KEY
|
||||
```
|
||||
|
||||
You can also install docker on a [raspberry pi](https://www.raspberrypi.org/) for instance with [hypriot](http://blog.hypriot.com/getting-started-with-docker-on-your-arm-device/) or with [archlinux](https://archlinuxarm.org/packages/arm/docker). You just need to build the arm image:
|
||||
```
|
||||
docker build -f raspberry.Dockerfile -t mumbledj .
|
||||
```
|
||||
|
||||
## Usage
|
||||
MumbleDJ is a compiled program that is executed via a terminal.
|
||||
|
||||
|
|
20
raspberry.Dockerfile
Normal file
20
raspberry.Dockerfile
Normal file
|
@ -0,0 +1,20 @@
|
|||
FROM hypriot/rpi-alpine-scratch:v3.3
|
||||
|
||||
ENV GOPATH=/
|
||||
|
||||
RUN echo "https://dl-cdn.alpinelinux.org/alpine/v3.3/community" >> /etc/apk/repositories
|
||||
RUN apk add --update ca-certificates go ffmpeg make build-base opus-dev python aria2
|
||||
RUN apk upgrade
|
||||
|
||||
RUN wget https://yt-dl.org/downloads/latest/youtube-dl -O /bin/youtube-dl && chmod a+x /bin/youtube-dl
|
||||
|
||||
COPY . /src/github.com/matthieugrieger/mumbledj
|
||||
COPY config.yaml /root/.config/mumbledj/config.yaml
|
||||
|
||||
WORKDIR /src/github.com/matthieugrieger/mumbledj
|
||||
|
||||
RUN make
|
||||
RUN make install
|
||||
RUN apk del go make build-base && rm -rf /var/cache/apk/*
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/mumbledj"]
|
Reference in a new issue