Permalink
Browse files

Add Docker Compose development environment

Signed-off-by: Tom Duffield <tom@chef.io>
  • Loading branch information...
tduffield committed Mar 13, 2017
1 parent c0a71e1 commit 52c5119f17be33858a75b2243052b6c52d480854
Showing with 62 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +13 −0 Dockerfile
  3. +6 −0 Gemfile
  4. +8 −0 Guardfile
  5. +15 −0 docker-compose.yml
  6. +12 −0 lita_config.rb
  7. +7 −0 start
@@ -1,6 +1,7 @@
*.gem
*.rbc
.bundle
.docker_bundle
.config
.yardoc
Gemfile.lock
@@ -0,0 +1,13 @@
FROM ruby:2.3
MAINTAINER Tom Duffield <tom@chef.io>
# We need `git` because oftentimes .gemspec depends on it for listing files
RUN apt-get update && \
apt-get install -y git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN gem install bundler && mkdir /app
COPY start /start
WORKDIR /app
CMD ["/start"]
@@ -1,3 +1,9 @@
source "https://rubygems.org"
gemspec
group :docker do
gem "lita-slack"
gem "guard"
gem "guard-process"
end
@@ -0,0 +1,8 @@
# Because we run Lita in a container, don't connect to STDIN
interactor :off
# Restart the lita CLI anytime we modify the lita_config or a lita file
guard "process", name: "Lita", command: "bundle exec lita" do
watch("lita_config.rb")
watch(%r{^lib/*})
end
@@ -0,0 +1,15 @@
version: '3'
services:
lita:
build: .
links:
- redis:redis
volumes:
# Sync all the local code to the app directory
- ./:/app
# Since we are syncing the whole directory, we need to make sure our local `.bundle` directory is not over-written
- ./.docker_bundle:/app/.bundle
environment:
- SLACK_TOKEN
redis:
image: redis
@@ -0,0 +1,12 @@
require "lita/adapters/slack"
Lita.configure do |config|
config.robot.log_level = :debug
config.robot.adapter = :slack
config.robot.admins = ["1"]
# Use the redis host linked via docker-compose
config.redis[:host] = "redis"
config.adapters.slack.token = ENV["SLACK_TOKEN"]
end
7 start
@@ -0,0 +1,7 @@
#!/bin/bash
# This file is intended for use only in the Docker environment. If you wish to run Expeditor locally, please run
# bundle exec lita
bundle install --path /var/bundle --jobs $(nproc) --clean
exec bundle exec guard

0 comments on commit 52c5119

Please sign in to comment.