1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-24 07:48:38 +00:00

add mediagoblin

This commit is contained in:
kev 2016-07-10 15:46:09 +08:00
parent e53889748c
commit ee811a6574
5 changed files with 201 additions and 1 deletions

@ -95,6 +95,7 @@ A collection of delicious docker recipes.
- [x] ffserver :beetle:
- [x] icecast
- [x] live555
- [x] mediagoblin
- [x] minidlna
- [x] murmur
- [x] plex :moneybag:
@ -105,6 +106,7 @@ A collection of delicious docker recipes.
- [x] tesseract
- [x] youtube-dl
- [x] youtube-worker :beetle:
- [x] zoneminder
## Web
@ -135,7 +137,6 @@ A collection of delicious docker recipes.
- [x] phpvirtualbox-arm
- [x] piwik
- [x] revive
- [x] zoneminder
## Security

91
mediagoblin/Dockerfile Normal file

@ -0,0 +1,91 @@
#
# Dockerfile for mediagoblin
#
FROM debian:jessie
MAINTAINER kev <noreply@easypi.info>
RUN set -xe \
&& apt-get update \
&& apt-get install -y automake \
gir1.2-gst-plugins-base-1.0 \
gir1.2-gstreamer-1.0 \
git-core \
gstreamer1.0-libav \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly \
gstreamer1.0-tools \
libasound2-dev \
libgstreamer-plugins-base1.0-dev \
libsndfile1-dev \
nginx \
nodejs-legacy \
npm \
poppler-utils \
python \
python-dev \
python-gi \
python-gst-1.0 \
python-gst-1.0 \
python-imaging \
python-lxml \
python-numpy \
python-scipy \
python-virtualenv \
python3-gi \
sudo \
&& rm -rf /var/lib/apt/lists/*
RUN set -xe \
&& useradd -d /var/lib/mediagoblin -m -r -g www-data mediagoblin \
&& groupadd -r mediagoblin \
&& usermod -a -G mediagoblin mediagoblin \
&& mkdir -p /var/log/mediagoblin \
/srv/mediagoblin.example.org/mediagoblin \
&& chown -hR mediagoblin:www-data /var/log/mediagoblin \
/srv/mediagoblin.example.org \
&& echo 'mediagoblin ALL=(ALL:ALL) NOPASSWD: /usr/sbin/nginx, /bin/chown' >> /etc/sudoers
USER mediagoblin
WORKDIR /srv/mediagoblin.example.org/mediagoblin
RUN set -xe \
&& git clone http://git.savannah.gnu.org/r/mediagoblin.git . \
&& git checkout stable \
&& git submodule sync \
&& git submodule update --force --init --recursive \
&& ./bootstrap.sh \
&& ./configure \
&& make \
&& bin/easy_install flup==1.0.3.dev-20110405 \
&& bin/pip install scikits.audiolab \
&& ln -s /var/lib/mediagoblin user_dev \
&& cp -av mediagoblin.ini mediagoblin_local.ini \
&& cp -av paste.ini paste_local.ini \
&& sed -i 's@.*sql_engine = .*@sql_engine = sqlite:////var/lib/mediagoblin/mediagoblin.db@' mediagoblin_local.ini \
&& { \
echo '[[mediagoblin.media_types.video]]'; \
echo '[[mediagoblin.media_types.audio]]'; \
echo '[[mediagoblin.media_types.pdf]]'; \
} >> mediagoblin_local.ini
COPY nginx.conf /etc/nginx/sites-enabled/default
VOLUME /var/lib/mediagoblin
EXPOSE 80
ENV MG_USER admin
ENV MG_PASS admin
ENV MG_MAIL admin@easypi.info
CMD set -xe \
&& sudo nginx \
&& sudo chown -hR mediagoblin:www-data /var/lib/mediagoblin \
&& bin/gmg dbupdate \
&& bin/gmg adduser --username "${MG_USER}" --password "${MG_PASS}" --email "${MG_MAIL}" \
&& bin/gmg makeadmin "${MG_USER}" \
&& ./lazyserver.sh --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543

34
mediagoblin/README.md Normal file

@ -0,0 +1,34 @@
mediagoblin
===========
[MediaGoblin][1] is a free software media publishing platform that anyone can
run. You can think of it as a decentralized alternative to Flickr, YouTube,
SoundCloud, etc.
## docker-compose.yml
```yaml
mediagoblin:
image: vimagick/mediagoblin
ports:
- "8080:80"
volumes:
- ./data:/var/lib/mediagoblin
environment:
- MG_USER=admin
- MG_PASS=admin
- MG_MAIL=admin@easypi.info
restart: always
```
## up and running
```bash
# start service
$ docker-compose up -d
# open browser
$ firefox http://localhost:8080/
```
[1]: http://mediagoblin.org/

@ -0,0 +1,11 @@
mediagoblin:
image: vimagick/mediagoblin
ports:
- "8080:80"
volumes:
- ./data:/var/lib/mediagoblin
environment:
- MG_USER=admin
- MG_PASS=admin
- MG_MAIL=admin@easypi.info
restart: always

63
mediagoblin/nginx.conf Normal file

@ -0,0 +1,63 @@
server {
#################################################
# Stock useful config options, but ignore them :)
#################################################
include /etc/nginx/mime.types;
autoindex off;
default_type application/octet-stream;
sendfile on;
# Gzip
gzip on;
gzip_min_length 1024;
gzip_buffers 4 32k;
gzip_types text/plain application/x-javascript text/javascript text/xml text/css;
#####################################
# Mounting MediaGoblin stuff
# This is the section you should read
#####################################
# Change this to update the upload size limit for your users
client_max_body_size 800m;
# prevent attacks (someone uploading a .txt file that the browser
# interprets as an HTML file, etc.)
add_header X-Content-Type-Options nosniff;
server_name mediagoblin.example.org www.mediagoblin.example.org;
access_log /var/log/nginx/mediagoblin.example.access.log;
error_log /var/log/nginx/mediagoblin.example.error.log;
# MediaGoblin's stock static files: CSS, JS, etc.
location /mgoblin_static/ {
alias /srv/mediagoblin.example.org/mediagoblin/mediagoblin/static/;
}
# Instance specific media:
location /mgoblin_media/ {
alias /srv/mediagoblin.example.org/mediagoblin/user_dev/media/public/;
}
# Theme static files (usually symlinked in)
location /theme_static/ {
alias /srv/mediagoblin.example.org/mediagoblin/user_dev/theme_static/;
}
# Plugin static files (usually symlinked in)
location /plugin_static/ {
alias /srv/mediagoblin.example.org/mediagoblin/user_dev/plugin_static/;
}
# Mounting MediaGoblin itself via FastCGI.
location / {
fastcgi_pass 127.0.0.1:26543;
include /etc/nginx/fastcgi_params;
# our understanding vs nginx's handling of script_name vs
# path_info don't match :)
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_NAME "";
}
}