-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
132 additions
and
0 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,32 @@ | ||
FROM python:2.7-slim | ||
|
||
# Install base softwares | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
libcurl4-gnutls-dev \ | ||
libgnutls28-dev \ | ||
build-essential \ | ||
python-magic \ | ||
chromium-driver chromium redis-server && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Add source to container | ||
ADD . /opt/mjcast-src | ||
|
||
# Install python module | ||
RUN pip install -r /opt/mjcast-src/requirements.txt && \ | ||
cd /opt/mjcast-src && python ./setup.py install | ||
|
||
# Add extra resources | ||
RUN mkdir /var/log/mjcast && \ | ||
chown nobody.nogroup /var/log/mjcast && \ | ||
chmod +x /opt/mjcast-src/docker/docker-entrypoint.sh && \ | ||
mkdir /etc/mjcast && \ | ||
cp -a /opt/mjcast-src/etc/mjcast/mjcast.yml.example /etc/mjcast/mjcast.yml && \ | ||
mkdir /usr/share/mjcast && cp /opt/mjcast-src/share/mjcast/loading.jpg /usr/share/mjcast/loading.jpg | ||
|
||
EXPOSE 8670 | ||
|
||
ENTRYPOINT ["/opt/mjcast-src/docker/docker-entrypoint.sh"] | ||
|
||
# Run mjcast in foreground | ||
CMD ["mjcast", "-f"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
echo "Starting redis server ..." | ||
redis-server > /dev/null 2>&1& | ||
echo "${@}" | ||
$@ |
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,78 @@ | ||
general: | ||
listen_addr: 0.0.0.0 | ||
listen_port: 8670 | ||
charset: utf-8 | ||
content_type: 'application/json; charset=utf-8' | ||
max_workers: 10 | ||
loading_file: '/usr/share/mjcast/loading.jpg' | ||
redis: | ||
playlist: | ||
url: 'redis://127.0.0.1:6379?db=0' | ||
plugins: | ||
playlist: | ||
- | ||
name: google_news | ||
executable_path: '/usr/bin/chromedriver' | ||
binary_location: '/usr/bin/chromium' | ||
datetime: | ||
color: [0, 0, 0] | ||
scale: 1.2 | ||
thickness: 2 | ||
url: 'https://news.google.com/news/headlines?ned=us&gl=US&hl=en' | ||
delay: 1 | ||
ttl: 20 | ||
wait: 10 | ||
options: | ||
- '--no-sandbox' # only if you running daemon as root | ||
- '--headless' | ||
- '--disable-gpu' | ||
- '--window-size=1920,1080' | ||
- '--hide-scrollbars' | ||
- | ||
name: prometheus | ||
executable_path: '/usr/bin/chromedriver' | ||
binary_location: '/usr/bin/chromium' | ||
datetime: | ||
color: [255, 255, 255] | ||
scale: 1.2 | ||
thickness: 2 | ||
url: 'https://prometheus.io/assets/grafana_prometheus.png' | ||
delay: 1 | ||
ttl: 20 | ||
wait: 10 | ||
options: | ||
- '--no-sandbox' # only if you running daemon as root | ||
- '--headless' | ||
- '--disable-gpu' | ||
- '--window-size=1920,1080' | ||
- '--hide-scrollbars' | ||
- | ||
name: bing | ||
executable_path: '/usr/bin/chromedriver' | ||
binary_location: '/usr/bin/chromium' | ||
datetime: | ||
color: [130, 7, 170] | ||
scale: 1.2 | ||
thickness: 2 | ||
url: 'https://www.bing.com' | ||
delay: 1 | ||
ttl: 20 | ||
wait: 10 | ||
options: | ||
- '--no-sandbox' # only if you running daemon as root | ||
- '--headless' | ||
- '--disable-gpu' | ||
- '--window-size=1920,1080' | ||
- '--hide-scrollbars' | ||
modules: | ||
server: | ||
routes: | ||
status: | ||
handler: 'status' | ||
name: 'server/status' | ||
op: 'GET' | ||
stream: | ||
safe_init: true | ||
handler: 'stream' | ||
name: 'server/stream' | ||
op: 'GET' |