Skip to content

Instantly share code, notes, and snippets.

@KharmaScribbles
Created June 1, 2018 05:56
Show Gist options
  • Save KharmaScribbles/a5e1e276d3d10e17518b8b222e54092a to your computer and use it in GitHub Desktop.
Save KharmaScribbles/a5e1e276d3d10e17518b8b222e54092a to your computer and use it in GitHub Desktop.
Hastbin Dockerfile (( forked from https://forge.cadoles.com/pcaseiro/dk-hastebin ))
# Base image
FROM gliderlabs/alpine:3.3
MAINTAINER Philippe Caseiro <pcaseiro@cadoles.com>
# Install Nodejs
RUN apk add --no-cache nodejs
RUN apk add --no-cache git
# Clone haste-server from git
RUN mkdir /opt
RUN git clone git://github.com/seejohnrun/haste-server.git /opt/haste
# Adding customization theme setup to haste
ADD opt/config.js /opt/haste/
# Override logo and CSS
ADD opt/logo.png /opt/haste/static/
ADD opt/application.css /opt/haste/static/
ADD opt/highlight.min.js /opt/haste/static/
ADD opt/highlight.css /opt/haste/static/
# Adjust title
RUN sed -i -e "s/<title>hastebin<\/title>/<title>Cadoles's pastebin<\/title>/g" /opt/haste/static/index.html
RUN sed -i -e "s/haste('hastebin'/haste('Cadoles\\\'s pastebin'/g" /opt/haste/static/index.html
RUN sed -i -e 's/<script type="text\/javascript" src="highlight.min.js"><\/script>/<script type="text\/javascript" src="highlight.min.js"><\/script><link rel="stylesheet" href="highlight.css">/g' /opt/haste/static/index.html
# Set working directory
WORKDIR /opt/haste
# Install haste-server
#ENV HTTP_PROXY "http://192.168.xxx.xxx:xxxx"
#RUN export https_proxy="${HTTP_PROX}"
RUN npm install
# Expose guest port and volume
EXPOSE 7777
VOLUME ["/opt/haste/data"]
# Start actual haste-server
CMD npm start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment