Sign inSign up

gabe565/0bin

By gabe565

Updated over 7 years ago

📋 An alpine-based docker image to run 0bin (A Pastebin alternative).

Image
1

100K+

gabe565/0bin repository overview

gabe565/0bin

An alpine-based docker image to run 0bin.

Quick Start

Run the 0bin image:

docker run --name 0bin --detach gabe565/0bin

If you wil access the image from another machine, you will need to add the server port mapping. This example will bind to port 8080 of the host machine:

docker run --name 0bin -p 8080:80 -d gabe565/0bin

For data persistance, make sure that the /data directory is bound to a volume or local directory.

docker volume create 0bin_data
docker run --name 0bin -p 8080:80 -v 0bin_data:/data -d gabe565/0bin

Environment

Most of the original 0bin options can be changed through environment variables to allow for customization.
Some of the defaults have been changed to work more smoothly with Docker, listed below.

VariableDescriptionDefault Value
HOSTIP address to bind to.0.0.0.0
PORTPost to listen on.80
DEBUGEnable debug output on 500 errors and watch files for hotswapping.false
USERThe user to run under after startup.root
GROUPGroup to run under after startup.Match USER
COMPRESSED_STATIC_FILESServe minified css and js files.true
PASTE_FILES_ROOTLocation to store encrypted paste files./data
CUSTOM_TEMPLATE_DIRLocation of custom template files. Templates here take precedence over the built-in templates./views
MENUAllows the navigation menu to be changed.[["Home","/"],["Download 0bin","https://github.com/sametmax/0bin"],["Faq","/faq/"],["Contact","mailto:[email protected]"]]
MAX_SIZEMaximum paste filesize. Careful with this one since pastes are client-side encrypted. Large files can slow down a user's browser.~500KB
DISPLAY_COUNTEREnable or disable the paste counter in the page footer.true
REFRESH_COUNTERHow often to refresh the paste counter.60 * 1
PASTE_ID_LENGTHLength of the generated URL paste ID.8

Theming

The CUSTOM_TEMPLATE_DIR environment variable allows for a directory to be used for modified templates while still falling back to the defaults. This location defaults to /views.

Pulling the Default Templates

To pull these into a local directory, run the following with the container running:

docker cp 0bin:/app/zerobin/views views 

Then the templates will be available for modification in your local directory.

Serving Custom Templates

To serve these templates in the container, restart it with a read-only volume binding to ./views:

docker run --name 0bin -p 8080:80 -v data:/data -v ./views:/views:ro -d gabe565/0bin

Tag summary

Content type

Image

Digest

Size

33.1 MB

Last updated

over 7 years ago

docker pull gabe565/0bin