Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
janschultecom committed Jun 4, 2016
1 parent 95f7753 commit 6fff209
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM java:8-jdk
MAINTAINER Jan Schulte <[email protected]>

ENV TRIFECTA_VERSION=0.21.0 TRIFECTA_URL=https://github.com/ldaniels528/trifecta/releases/download

WORKDIR /home
RUN wget $TRIFECTA_URL/v$TRIFECTA_VERSION/trifecta_ui-$TRIFECTA_VERSION.zip && \
unzip trifecta_ui-$TRIFECTA_VERSION.zip && \
rm trifecta_ui-$TRIFECTA_VERSION.zip && \
mv trifecta_ui-$TRIFECTA_VERSION trifecta

COPY config.properties setup.sh entrypoint.sh ./trifecta/
RUN groupadd -r trifecta && useradd -r -g trifecta trifecta && chown -R trifecta /home && chgrp -R trifecta /home && chmod a+x trifecta/entrypoint.sh
USER trifecta

WORKDIR /home/trifecta

VOLUME /home/trifecta/conf
EXPOSE 9000

ENTRYPOINT /home/trifecta/entrypoint.sh
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# docker-trifecta
Trifecta docker image

Start the container with the following command:

```sh
docker run -d --rm --name trifecta -p 9000:9000 -e ZK_HOST=localhost:2181 janschultecom/trifecta
```
where ZK_HOST is the url to your Zookeeper instance (e.g. localhost:2181).
17 changes: 17 additions & 0 deletions config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# the embedded web server host/IP and port for client connections
trifecta.web.host = localhost
trifecta.web.port = 9000

trifecta.zookeeper.host = {{ZK_HOST}}

# the interval (in seconds) that changes to consumer offsets will be pushed to web-socket clients
trifecta.web.push.interval.consumer = 15

# the interval (in seconds) that sampling messages will be pushed to web-socket clients
trifecta.web.push.interval.sampling = 2

# the interval (in seconds) that changes to topics (new messages) will be pushed to web-socket clients
trifecta.web.push.interval.topic = 15

# the number of actors to create for servicing requests
trifecta.web.actor.concurrency = 10
13 changes: 13 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Setup trifecta configuration
mkdir .trifecta
chmod a+x setup.sh
mv setup.sh .trifecta/
mv config.properties .trifecta/
cd .trifecta
sh setup.sh

# Start ui
cd ..
bin/trifecta_ui

9 changes: 9 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
if [ -z ${ZK_HOST+x} ];
then
echo "Zookeeper host not set, using localhost";
sed -i -e s/{{ZK_HOST}}/localhost/ config.properties
else
echo "Using Zookeeper host: '$ZK_HOST'";
sed -i -e s/{{ZK_HOST}}/${ZK_HOST}/ config.properties
fi

0 comments on commit 6fff209

Please sign in to comment.