You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

42 lines
1.5 KiB

  1. FROM golang:latest
  2. # Install redis, nginx, daemontools, etc.
  3. RUN echo deb http://http.debian.net/debian wheezy-backports main > /etc/apt/sources.list.d/backports.list && \
  4. apt-get update && \
  5. apt-get install -y --no-install-recommends -t wheezy-backports redis-server && \
  6. apt-get install -y --no-install-recommends graphviz nginx-full daemontools unzip
  7. # Configure redis.
  8. ADD deploy/redis.conf /etc/redis/redis.conf
  9. # Configure nginx.
  10. RUN echo "daemon off;" >> /etc/nginx/nginx.conf && \
  11. rm /etc/nginx/sites-enabled/default
  12. ADD deploy/gddo.conf /etc/nginx/sites-enabled/gddo.conf
  13. # Configure daemontools services.
  14. ADD deploy/services /services
  15. # Manually fetch and install gddo-server dependencies (faster than "go get").
  16. ADD https://github.com/garyburd/redigo/archive/779af66db5668074a96f522d9025cb0a5ef50d89.zip /x/redigo.zip
  17. ADD https://github.com/golang/snappy/archive/master.zip /x/snappy-go.zip
  18. RUN unzip /x/redigo.zip -d /x && unzip /x/snappy-go.zip -d /x && \
  19. mkdir -p /go/src/github.com/garyburd && \
  20. mkdir -p /go/src/github.com/golang && \
  21. mv /x/redigo-* /go/src/github.com/garyburd/redigo && \
  22. mv /x/snappy-master /go/src/github.com/golang/snappy && \
  23. rm -rf /x
  24. # Build the local gddo files.
  25. ADD . /go/src/github.com/golang/gddo
  26. RUN go get github.com/golang/gddo/gddo-server
  27. # Exposed ports and volumes.
  28. # /ssl should contain SSL certs.
  29. # /data should contain the Redis database, "dump.rdb".
  30. EXPOSE 80 443
  31. VOLUME ["/ssl", "/data"]
  32. # How to start it all.
  33. CMD svscan /services