Giter Site home page Giter Site logo

mtlynch / mediagoblin-docker Goto Github PK

View Code? Open in Web Editor NEW
26.0 3.0 12.0 98 KB

Docker image for MediaGoblin, adapted from https://notabug.org/dachary/mediagoblin-docker

License: GNU Affero General Public License v3.0

Dockerfile 60.67% Shell 39.33%

mediagoblin-docker's Introduction

CircleCI Docker Pulls License: AGPL v3

QuickStart

docker run \
  --tty \
  --detach \
  --publish 8080:6543 \
  --name mediagoblin \
  mtlynch/mediagoblin

MediaGoblin will be available at http://localhost:8080

The default user is admin, password admin.

Run MediaGoblin with persistent state

To preserve data across container executions, run the following:

mkdir -p persist/srv/mediagoblin

docker run \
  --tty \
  --detach \
  --publish 8080:6543 \
  --volume "${PWD}/persist/srv/mediagoblin:/var/lib/mediagoblin" \
  --name mediagoblin \
  mtlynch/mediagoblin

MediaGoblin will be available at http://localhost:8080

The default user is admin, password admin.

MediaGoblin will save data to ./persist/srv/mediagoblin

Build container from source

To rebuild this container, copy this repository locally and run:

docker build --tag mediagoblin .

mediagoblin-docker's People

Contributors

bobthebadguy avatar mtlynch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mediagoblin-docker's Issues

Documentation: Persistance & docker-compose

Hi there and thanks for the docker image. Attempting to run a persistent media-goblin service, I found that I had to make the following adjustments, and I wanted to share them:

There are some things to be done:

  • Remove $mediadir/media/public/public before container start. If this symlink exists, the container will throw an error on startup
  • mount-bind mediagoblin.db
  • mount-bind datadir
  • if you want, mount-bind mediagoblin_local.ini

I created a gist for this: https://gist.github.com/praul/77bdee81a6bb16b609954879e96ec8cd

It works with this docker-compose.yml and this startup script. You have to have the same paths in docker-compose and startup.sh. It is somewhat of a workaround with this script, but I wanted to leave the image untouched.

Note: For some reason, the user activation link is not shown anymore in logs. You have to login with admin:admin and edit/approve users there.

startup.sh:

#!/bin/bash
mediadir=/docker/user/datas/mediagoblin/media
dbdir=/docker/user/datas/mediagoblin/db

docker-compose down --remove-orphans
mkdir "$mediadir" && chmod 777 "$mediadir"
rm "$mediadir/media/public/public"
touch "$dbdir/mediagoblin.db" && chmod 777 "$dbdir/mediagoblin.db"
docker-compose up -d

docker-compose.yml

version: "3"
services:
  mediagoblin:
    image: mtlynch/mediagoblin
    
    ports: 
      - 6543:6543
    volumes:
      - /docker/user/datas/mediagoblin/media:/var/lib/mediagoblin #Your Media Path. Adjust Path in start.sh accordingly
      - /docker/user/datas/mediagoblin/db/mediagoblin.db:/srv/mediagoblin.example.org/mediagoblin/mediagoblin.db  #Your Database Path. Adjust Path in start.sh accordingly
      - ./mediagoblin_local.ini:/srv/mediagoblin.example.org/mediagoblin/mediagoblin_local.ini
    restart: unless-stopped

mediagoblin_local.ini (untouched)

# If you want to make changes to this file, first copy it to
# mediagoblin_local.ini, then make the changes there.
#
# If you don't see what you need here, have a look at mediagoblin/config_spec.ini
# It defines types and defaults so it's a good place to look for documentation
# or to find hidden options that we didn't tell you about. :)

# To change the directory you should make sure you change the
# directory in paste.ini and/or your webserver configuration.
#
# [DEFAULT]
# data_basedir = "/var/lib/mediagoblin"

[mediagoblin]
direct_remote_path = /mgoblin_static/
email_sender_address = "[email protected]"

## Uncomment and change to your DB's appropiate setting.
## Default is a local sqlite db "mediagoblin.db".
## Don't forget to run `./bin/gmg dbupdate` after having changed it.
# sql_engine = postgresql:///mediagoblin

# Set to false to enable sending notices
email_debug_mode = true

# Set to false to disable registrations
allow_registration = true

# Set to false to disable the ability for users to report offensive content
allow_reporting = true

## Uncomment this to put some user-overriding templates here
# local_templates = %(data_basedir)s/templates/

## You can set your theme by specifying this (not specifying it will
## use the default theme).  Run `gmg assetlink` to apply the change.
## The airy and sandyseventiesspeedboat theme comes with GMG; please
## see the theming docs on how to install other themes.
# theme = airy

## If you want the terms of service displayed, you can uncomment this
# show_tos = true

user_privilege_scheme = "uploader,commenter,reporter"
[storage:queuestore]
base_dir = %(data_basedir)s/media/queue

[storage:publicstore]
base_dir = %(data_basedir)s/media/public
base_url = /mgoblin_media/

[celery]
# Put celery stuff here

# Place plugins here, each in their own subsection of [plugins].
# See http://docs.mediagoblin.org/siteadmin/plugins.html for details.
[plugins]
[[mediagoblin.plugins.geolocation]]
[[mediagoblin.plugins.basic_auth]]
[[mediagoblin.plugins.processing_info]]
[[mediagoblin.media_types.image]]

Persistent install?

I am trying to figure out how to install this with a persistent copy of all the important files outside of the container. I tried simply mapping /srv/mediagoblin.example.org/mediagoblin to an external directory but that caused the install to fail. As /srv/mediagoblin.example.org/mediagoblin only exists in the container, if I try and update the container will that not get destroyed? Even though my content will be safe I believe the database of what is actually in Mediagoblin along with users etc will be destroyed. Am I missing something?

Where are user accounts stored?

Hello,

I'm new to media goblin, and this is probably a total noob question. I'm running media goblin in unRAID (with this Docker container). I've mapped the media path, but I'm wondering where the user accounts are stored, and how I can make sure they are persisted through container upgrades. Maybe I need more documentation on "how to maintain this Docker image," and I'm just not able to find it. Any help or pointers are appreciated!

EDIT: Twice now I've changed mounted paths on my container and it's blown away my user account and admin password. How do I avoid that?

I also left a comment on this pull request. I think I'm running into a bug.. https://github.com/mtlynch/mediagoblin-docker/pull/46/files#diff-8742b88fc99029dc5d3859a7242c5208R20

Thank you!

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.