/docker-hastebin

Alpine-based Docker image for Hastebin, the node.js paste service

Primary LanguageJavaScriptMIT LicenseMIT

Hastebin

https://hub.docker.com/r/angristan/hastebin/ https://hub.docker.com/r/angristan/hastebin/ https://hub.docker.com/r/angristan/hastebin/ https://hub.docker.com/r/angristan/hastebin/

Hastebin is an open-source pastebin software written in node.js.

This image is automatically built by GitLab CI and pushed to the Docker Hub.

I won't update this image anymore. Feel free to fork the repo.

Features

  • Based on Alpine Linux.
  • Latest code from seejohnrun/haste-server
  • Ran as an unprivileged user (see UID and GID)
  • Uses the default file storage driver (no expiration).

Build-time variables

  • HASTEBIN_VER: A commit or a branch since the repo doesn't have tags (default: master)

Environment variables

  • GID: user id (default: 4242)
  • UID: group id (default: 4242)

Usage

docker run -d \
  --name hastebin \
  -p 80:7777 \
  angristan/hastebin:latest

As said above, the container will run as 4242:4242 by default, but you can specify the UID and GID yourself:

docker run -d \
  --name hastebin \
  -p 80:7777 \
  -e UID=4242 \
  -e GID=4242 \
  angristan/hastebin:latest

Volume

By default, the container will create a volume to store /app/data. This is where your pastes will be stored.

You can specify a volume yourself:

docker run -d \
  --name hastebin \
  --mount source=hastebin,target=/app/data \
  -p 80:7777 \
  -e UID=4242 \
  -e GID=4242 \
  angristan/hastebin:latest

Or use a bind mount:

docker run -d \
  --name hastebin \
  --mount type=bind,source="$(pwd)"/data,target=/app/data \
  -p 80:7777 \
  -e UID=4242 \
  -e GID=4242 \
  angristan/hastebin:latest

Docker Compose

A docker-compose.yml example:

version: '2.3'

services:
  hastebin:
    container_name: hastebin
    image: angristan/hastebin:latest
    restart: always
    volumes:
      - ./data:/app/data
    ports:
      - "80:7777"
    environment:
     - UID=4242
     - GID=4242