Skip to content

Commit

Permalink
add Dockerfile, docker-compose.yml. updated examples/cluster document…
Browse files Browse the repository at this point in the history
…ation

closes #49
  • Loading branch information
llonchj authored and travisjeffery committed Oct 12, 2017
1 parent 565363f commit 960d403
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM golang:1.9-alpine

RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh make

RUN go get -u github.com/kardianos/govendor
ADD . /go/src/github.com/travisjeffery/jocko
WORKDIR /go/src/github.com/travisjeffery/jocko
RUN govendor sync
RUN govendor test -v -p=1 +local
RUN go build -o jocko cmd/jocko/main.go
RUN go build -o createtopic cmd/createtopic/main.go

FROM alpine:latest

COPY --from=0 /go/src/github.com/travisjeffery/jocko/jocko /usr/local/bin/jocko
COPY --from=0 /go/src/github.com/travisjeffery/jocko/createtopic /usr/local/bin/createtopic

EXPOSE 9092 9093 9094

VOLUME "/tmp/jocko"

CMD ["jocko"]
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'

services:

jocko_main:
build:
context: .
image: jocko

jocko_cluster:
build:
context: .
image: jocko
command: jocko --serfmembers=jocko_main:9094
4 changes: 4 additions & 0 deletions examples/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ $ ./jocko broker \
--serfmembers=127.0.0.1:9003 \
--id=3
```

## docker-compose cluster

To start a [docker compose](https://docs.docker.com/compose/) cluster node use the provided `/docker-compose.yml`.

0 comments on commit 960d403

Please sign in to comment.