forked from SDGophers/gddo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (33 loc) · 1.52 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:latest
# Install redis, nginx, daemontools, etc.
RUN echo deb http://http.debian.net/debian wheezy-backports main > /etc/apt/sources.list.d/backports.list && \
apt-get update && \
apt-get install -y --no-install-recommends -t wheezy-backports redis-server && \
apt-get install -y --no-install-recommends graphviz nginx-full daemontools unzip
# Configure redis.
ADD deploy/redis.conf /etc/redis/redis.conf
# Configure nginx.
RUN echo "daemon off;" >> /etc/nginx/nginx.conf && \
rm /etc/nginx/sites-enabled/default
ADD deploy/gddo.conf /etc/nginx/sites-enabled/gddo.conf
# Configure daemontools services.
ADD deploy/services /services
# Manually fetch and install gddo-server dependencies (faster than "go get").
ADD https://github.com/garyburd/redigo/archive/779af66db5668074a96f522d9025cb0a5ef50d89.zip /x/redigo.zip
ADD https://snappy-go.googlecode.com/archive/12e4b4183793ac4b061921e7980845e750679fd0.tar.gz /x/snappy-go.tar.gz
RUN unzip /x/redigo.zip -d /x && tar xzvf /x/snappy-go.tar.gz -C /x && \
mkdir -p /go/src/github.com/garyburd && \
mkdir -p /go/src/code.google.com/p && \
mv /x/redigo-* /go/src/github.com/garyburd/redigo && \
mv /x/snappy-go-* /go/src/code.google.com/p/snappy-go && \
rm -rf /x
# Build the local gddo files.
ADD . /go/src/github.com/golang/gddo
RUN go install github.com/golang/gddo/gddo-server
# Exposed ports and volumes.
# /ssl should contain SSL certs.
# /data should contain the Redis database, "dump.rdb".
EXPOSE 80 443
VOLUME ["/ssl", "/data"]
# How to start it all.
CMD svscan /services