Skip to content

Commit

Permalink
Initial.
Browse files Browse the repository at this point in the history
  • Loading branch information
HurricaneHernandez committed Oct 23, 2014
0 parents commit 5b0e1da
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 0 deletions.
59 changes: 59 additions & 0 deletions Dockerfile
@@ -0,0 +1,59 @@
#TinyMediaManager
FROM ubuntu:trusty
MAINTAINER Carlos Hernandez <carlos@techbyte.ca>

# Let the container know that there is no tty
ENV DEBIAN_FRONTEND noninteractive

# Set locale to UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LANG en_US.UTF-8
RUN locale-gen en_US en_US.UTF-8
RUN update-locale LANG=en_US.UTF-8
RUN dpkg-reconfigure locales

# Set user nobody to uid and gid of unRAID, uncomment for unRAID
RUN usermod -u 99 nobody
RUN usermod -g 100 nobody
RUN usermod -m -d /nobody nobody
RUN usermod -s /bin/bash nobody

# Update ubuntu
RUN apt-mark hold initscripts udev plymouth mountall
RUN apt-get -q update
RUN apt-get dist-upgrade -qy && apt-get -q update

# Install vnc, xvfb in order to creat a 'fake' display novnc
RUN apt-get install -qy --force-yes x11vnc xvfb openjdk-7-jre cron postfix supervisor rsyslog wget
RUN wget http://github.com/kanaka/noVNC/tarball/master -O noVNC.tar && mkdir /noVNC && tar -xf noVNC.tar --strip-components 1 -C /noVNC

# Setup vnc
RUN mkdir /nobody && cp -R ~/.[a-zA-Z0-9]* /nobody
RUN mkdir /nobody/.vnc
# Setup a password
RUN x11vnc -storepasswd 1234 /nobody/.vnc/passwd

# change ownership for unRAID
RUN chown -R nobody:users /nobody /noVNC

# Cleanup
RUN apt-get -y autoremove

# Add config files
ADD ./files/supervisor.conf /etc/supervisor/conf.d/common.conf
ADD ./files/cron-supervisor.conf /etc/supervisor/conf.d/cron.conf
ADD ./files/crontab /etc/crontab
ADD ./files/rsyslog-supervisor.conf /etc/supervisor/conf.d/rsyslog.conf
ADD ./files/x11vnc-supervisor.conf /etc/supervisor/conf.d/x11vnc.conf
ADD ./files/cron-rsyslog.conf /etc/rsyslog.d/60-cron.conf
ADD ./files/start.sh /start.sh
RUN chown root:root /etc/supervisor/conf.d/* /etc/crontab /etc/rsyslog.d/60-cron.conf

# Expose default vnc port
EXPOSE 5900
# Start tinnyMediaManager on login
RUN bash -c 'echo "cd /tmm" >> /nobody/.bashrc'
RUN bash -c 'echo "./tinyMediaManager.sh" >> /nobody/.bashrc'
# Make start script executable and default command
RUN chmod +x /start.sh
ENTRYPOINT ["/start.sh"]
20 changes: 20 additions & 0 deletions LICENSE
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2014 Carlos Hernandez

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 changes: 30 additions & 0 deletions README.md
@@ -0,0 +1,30 @@
#docker TinnyMediaManager

## Description:

This is a Dockerfile for "TinnyMediaManager" - (http://www.tinymediamanager.org/)

## Build from docker file:

```
git clone --depth=1 https://github.com/hurricanehernandez/tmm.git
cd tmm
docker build --rm=true -t tmm .
```

## Volumes:

#### `/media`

Location of media, that you want managed by media manager.

#### `/tmm`

Install directory of TinyMediaManager.

## Docker run command:

```
docker run -d -p 5900:5900 -v /*tmm_install_dir_on_host:/tmm -v /*your_media_location*:/media -v /etc/localtime:/etc/localtime:ro --name=tmm hurricane/tmm
```
1 change: 1 addition & 0 deletions files/cron-rsyslog.conf
@@ -0,0 +1 @@
cron.* /tmm/rlogs/cron.log
6 changes: 6 additions & 0 deletions files/cron-supervisor.conf
@@ -0,0 +1,6 @@
[program:cron]
command = cron -f -L 15
startsecs = 5
stopwaitsecs = 3600
stopasgroup = false
killasgroup = true
5 changes: 5 additions & 0 deletions files/crontab
@@ -0,0 +1,5 @@
# system-wide crontab
SHELL=/bin/bash

# m h dom mon dow user command
0 0 * * * nobody cd tmm && ./tinyMediaManagerCMD.sh -update -scrapeNew -renameNew 2>&1 | logger -p cron.info -i
8 changes: 8 additions & 0 deletions files/noVNC-supervisor.conf
@@ -0,0 +1,8 @@
[program:novnc]
priority=25
directory=/noVNC
command=/noVNC/utils/launch.sh
user=nobody
autostart=true
autorestart=true
stopsignal=QUIT
4 changes: 4 additions & 0 deletions files/rsyslog-supervisor.conf
@@ -0,0 +1,4 @@
[program:rsyslog]
command = rsyslogd -n -c3
startsecs = 5
stopwaitsecs = 5
7 changes: 7 additions & 0 deletions files/start.sh
@@ -0,0 +1,7 @@
#!/bin/bash

mkdir -p /tmm/rlogs/supervisor
touch /tmm/rlogs/cron.log
chmod 666 /tmm/rlogs/cron.log
chmod +x /tmm/tinyMediaManager.sh /tmm/tinyMediaManagerCMD.sh
supervisord -n
2 changes: 2 additions & 0 deletions files/supervisor.conf
@@ -0,0 +1,2 @@
[supervisord]
childlogdir = /tmm/rlogs/supervisor
4 changes: 4 additions & 0 deletions files/x11vnc-supervisor.conf
@@ -0,0 +1,4 @@
[program:x11vnc]
command=x11vnc -forever -usepw -create
environment=HOME="/nobody",USER="nobody"
user=nobody

0 comments on commit 5b0e1da

Please sign in to comment.