-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
41 lines (37 loc) · 1.2 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM golang:1.8.3-alpine3.6
RUN apk add --update \
git \
py-pygments \
sudo \
nodejs nodejs-npm && npm install npm@latest -g \
&& rm -rf /var/cache/apk/* \
&& adduser -h /ghostbin -u 10000 -D -g "" ghostbin
USER ghostbin
ENV GOPATH=/ghostbin/go
RUN mkdir -p /ghostbin/go/src/github.com/DHowett \
&& git clone https://github.com/DHowett/ghostbin.git /ghostbin/go/src/github.com/DHowett/ghostbin \
&& cd /ghostbin/go/src/github.com/DHowett/ghostbin \
&& git checkout -b v1-stable c392751c67afa1c1f0c6771ab6a99da2ef5c5c41 \
# Change pygmentize path
&& sed -i -e 's:./bin/pygments/pygmentize:/usr/bin/pygmentize:g' languages.yml \
&& echo "Go get" \
&& go get \
&& echo "Go install" \
&& go install \
&& echo "Go build" \
&& go build \
&& npm install
WORKDIR /ghostbin/go/src/github.com/DHowett/ghostbin
USER root
RUN mkdir /logs \
&& chown -R ghostbin:ghostbin /logs \
&& mkdir /data \
&& chown -R ghostbin:ghostbin /data
EXPOSE 8619
VOLUME /logs
VOLUME /data
COPY ghostbin.sh /ghostbin/ghostbin.sh
# Ensure it's executable
RUN chmod +x /ghostbin/ghostbin.sh
ENTRYPOINT /ghostbin/ghostbin.sh
# CMD -addr="0.0.0.0:8619" -log_dir="/logs" -root="/data"