Permalink
Browse files

Dockerize Yetibot

  • Loading branch information...
devth committed Jan 6, 2016
1 parent ebf7bde commit 17bec462012b56090bddb475e51e3dd21256f8c2
Showing with 101 additions and 20 deletions.
  1. +3 βˆ’0 .dockerignore
  2. +19 βˆ’0 Dockerfile
  3. +24 βˆ’19 README.md
  4. +51 βˆ’0 doc/DOCKER.md
  5. +4 βˆ’1 project.clj
View
@@ -0,0 +1,3 @@
config/
.git/
target/
View
@@ -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"]
View
@@ -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
@@ -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
View
@@ -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
```
View
@@ -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

0 comments on commit 17bec46

Please sign in to comment.