Skip to content

Commit

Permalink
Docker build updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Jenkins committed Dec 12, 2015
1 parent e485c17 commit 1f8d77d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 22 deletions.
20 changes: 9 additions & 11 deletions Dockerfile
Expand Up @@ -5,25 +5,23 @@
FROM centos:latest FROM centos:latest
# OS setup # OS setup
RUN yum install -y make golang git RUN yum install -y make golang git
RUN mkdir -p /app/dispatchd RUN mkdir -p /app/dispatchd && mkdir -p /data/dispatchd/
RUN yum install -y python-setuptools.noarch RUN yum install -y python-setuptools.noarch gcc-c++ glibc-headers
RUN easy_install mako RUN easy_install mako
RUN yum install -y gcc-c++ glibc-headers


# protobuf # protobuf
RUN cd /tmp && curl -L -o protobuf-2.6.1.tar.gz https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz RUN cd /tmp && curl -L -o protobuf-2.6.1.tar.gz https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
RUN cd /tmp && tar -xzf protobuf-2.6.1.tar.gz RUN cd /tmp && tar -xzf protobuf-2.6.1.tar.gz
RUN cd /tmp/protobuf-2.6.1/ && ./configure && make install RUN cd /tmp/protobuf-2.6.1/ && ./configure && make install


# Build dispatchd # Build dispatchd
RUN mkdir -p /app/dispatchd/src/github.com/jeffjenkins/dispatchd/ ENV BUILD_DIR /app/dispatchd/src/github.com/jeffjenkins/dispatchd/
COPY . /app/dispatchd/src/github.com/jeffjenkins/dispatchd/ RUN mkdir -p $BUILD_DIR
COPY . $BUILD_DIR
ENV GOPATH /app/dispatchd ENV GOPATH /app/dispatchd
RUN cd /app/dispatchd/src/github.com/jeffjenkins/dispatchd/ && PATH=$PATH:$GOPATH/bin make install RUN cd $BUILD_DIR && PATH=$PATH:$GOPATH/bin make install


# Runtime configuration # Runtime configuration
# TODO: when running for real this should have a volume for ENV STATIC_PATH $BUILD_DIR/static
# the database directories RUN cp $BUILD_DIR/config.default.json /etc/dispatchd.json
RUN mkdir -p /data/dispatchd/ CMD ["/app/dispatchd/bin/server", "-config-file=/etc/dispatchd.json", "-persist-dir=/data/dispatchd/"]
ENV STATIC_PATH /app/dispatchd/src/github.com/jeffjenkins/dispatchd/static
ENTRYPOINT ["/app/dispatchd/bin/server"]
16 changes: 8 additions & 8 deletions Makefile
Expand Up @@ -13,14 +13,14 @@ protoc_present:
which protoc which protoc


deps: deps:
go get github.com/boltdb/bolt go get github.com/boltdb/bolt \
go get github.com/gogo/protobuf/gogoproto github.com/gogo/protobuf/gogoproto \
go get github.com/gogo/protobuf/proto github.com/gogo/protobuf/proto \
go get github.com/gogo/protobuf/protoc-gen-gogo github.com/gogo/protobuf/protoc-gen-gogo \
go get github.com/rcrowley/go-metrics github.com/rcrowley/go-metrics \
go get github.com/streadway/amqp github.com/streadway/amqp \
go get github.com/wadey/gocovmerge github.com/wadey/gocovmerge \
go get golang.org/x/crypto/bcrypt golang.org/x/crypto/bcrypt


gen_all: deps gen_pb gen_amqp gen_all: deps gen_pb gen_amqp


Expand Down
14 changes: 12 additions & 2 deletions README.md
Expand Up @@ -41,9 +41,19 @@ These options can be overridden if `-config-file` is specified. The config file


Right now the only config file exclusive options are for users and passwords. In the future the config file will have tuning parameters as well. Right now the only config file exclusive options are for users and passwords. In the future the config file will have tuning parameters as well.


## Packages ## Running Dispatchd


Dispatchd is currently only packaged as a docker image Dispatchd is currently only packaged as a docker image. You can run it with this command:

docker run \
-p=8080:8080 \
-p=5672:5672 \
--volume=YOUR_CONFIG_FILE:/etc/dispatchd.json \
--volume=YOUR_DATA_DIR:/data/dispatchd/ \
dispatchd/dispatchd

Config file can be left out for the default behaviors. The data volume needs
to be specified so that data is persisted outside of the container.


## Security/Auth ## Security/Auth


Expand Down
8 changes: 8 additions & 0 deletions config.default.json
@@ -0,0 +1,8 @@
{
"amqp-port" : 1111,
"users" : {
"guest" : {
"password_bcrypt_base64" : "JDJhJDExJENobGk4dG5rY0RGemJhTjhsV21xR3VNNnFZZ1ZqTzUzQWxtbGtyMHRYN3RkUHMuYjF5SUt5"
}
}
}
1 change: 0 additions & 1 deletion dev/config.json
@@ -1,5 +1,4 @@
{ {
"amqp-port" : 1111,
"users" : { "users" : {
"guest" : { "guest" : {
"password_bcrypt_base64" : "JDJhJDExJENobGk4dG5rY0RGemJhTjhsV21xR3VNNnFZZ1ZqTzUzQWxtbGtyMHRYN3RkUHMuYjF5SUt5" "password_bcrypt_base64" : "JDJhJDExJENobGk4dG5rY0RGemJhTjhsV21xR3VNNnFZZ1ZqTzUzQWxtbGtyMHRYN3RkUHMuYjF5SUt5"
Expand Down

0 comments on commit 1f8d77d

Please sign in to comment.