Skip to content

Commit

Permalink
Dockerize Yetibot
Browse files Browse the repository at this point in the history
  • Loading branch information
devth committed Jan 6, 2016
1 parent ebf7bde commit 17bec46
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
@@ -0,0 +1,3 @@
config/
.git/
target/
19 changes: 19 additions & 0 deletions Dockerfile
@@ -0,0 +1,19 @@
FROM clojure:lein-2.5.3

MAINTAINER Trevor Hartman <trevorhartman@gmail.com>

EXPOSE 3000

RUN mkdir -p /usr/src/app

COPY src /usr/src/app/

COPY project.clj /usr/src/app

WORKDIR /usr/src/app

RUN lein deps

VOLUME /usr/src/app/config/

CMD ["lein", "run"]
43 changes: 24 additions & 19 deletions README.md
@@ -1,6 +1,6 @@
# yetibot
# Yetibot

You can treat yetibot as a communal command line. It works well for:
You can treat Yetibot as a communal command line. It works well for:

- **teaching**: how to run internal automation, language evaluation for JS,
Scala, Clojure, and Haskell
Expand All @@ -22,26 +22,31 @@ Yetibot has been undergoing continuous improvement since its inception. These
are the immediate priorities, in addition to any bugfixes. Feedback and
contributions are very welcome!

0. Dockerize yetibot and Datomic Pro Starter edition to simplify deployment
0. Integrate with [StackStorm](https://stackstorm.com/) for automation on
steriods
0. Create a Heroku deploy button to make it easy to get started
0. Run a demo yetibot instance
- [ ] Dockerize Yetibot and Datomic Pro Starter edition to simplify deployment.
<em>In progress!</em>
- [x] Integrate with [StackStorm](https://stackstorm.com/) for automation on
steriods. Done! Check out
[yetibot-stackstorm](https://github.com/devth/yetibot-stackstorm).
- [ ] Create a Heroku deploy button to make it easy to get started
- [ ] Run a demo Yetibot instance

## Installation

There are two primary ways of installing yetibot:

1. **Clone this repo**: this gives you a standard yetibot installation and
provides a git-ignored place to store configuration.
2. **Make your own repo and depend on yetibot**: this gives you ultimate
customizability, allowing you to depend on custom yetibot plugins or define
your own commands in-project, and gives you control over where you store
your config (manual management, commit to private git repo, etc...)

```clojure
[yetibot "0.1.28"]
```
There are three primary ways of installing Yetibot:

0. Follow the [Docker instructions](doc/DOCKER.md): the fastest way if you're
already using Docker!
0. **Clone this repo**: this gives you a standard Yetibot installation and
provides a git-ignored place to store configuration. Run from the root dir
with `lein run`.
0. **Make your own repo and depend on Yetibot**: this gives you ultimate
customizability, allowing you to depend on custom Yetibot plugins or define
your own commands in-project, and gives you control over where you store
your config (manual management, commit to private git repo, etc...)

```clojure
[yetibot "0.1.28"]
```

## Configuration

Expand Down
51 changes: 51 additions & 0 deletions doc/DOCKER.md
@@ -0,0 +1,51 @@
# Docker

The official Yetibot image is
[devth/yetibot](https://hub.docker.com/devth/yetibot). It's built on the
official [Clojure image](https://hub.docker.com/_/clojure/).

## Configuration

Configuration must be passed in using the volume at `/usr/src/app/config`. The
mounted directory must contain a file `config.edn` as described by the [sample
config](https://github.com/devth/yetibot/blob/master/config/config-sample.edn).

## Ports

Yetibot runs a webapp on port `3000`. You may optionally expose it via `-P` or
`-p` to choose your own host port mapping.

## Running

Start up Yetibot in detached mode with port 3000 mapped:

```
# path to your config directory containing config.edn
YB_CONFIG_PATH=...
docker run --name yetibot \
-d -p 3000:3000 \
-v $YB_CONFIG_PATH:/usr/src/app/config \
devth/yetibot
```

<em>Note, if you're using Docker Machine, you can view the webapp at its IP
rather than localhost.</em>

Tail its logs:

```
docker logs -f yetibot
```

## Troubleshoting

To run an ephemeral interactive shell and poke around instead of running Yetibot:

```
docker run --rm -it --name yetibot \
-v $YB_CONFIG_PATH:/usr/src/app/config \
devth/yetibot \
/bin/bash
```

5 changes: 4 additions & 1 deletion project.clj
Expand Up @@ -31,10 +31,13 @@
; [incanter "1.4.0"]

]
:plugins [[lein-ring "0.9.5"]]
:plugins [[lein-ring "0.9.5"]
[io.sarnowski/lein-docker "1.1.0"]]

:pedantic :ignore

:docker {:image-name "devth/yetibot"}

:ring {:handler yetibot.webapp.handler/app
:init yetibot.webapp.handler/init
:destroy yetibot.webapp.handler/destroy
Expand Down

0 comments on commit 17bec46

Please sign in to comment.