Skip to content

Commit 52c5119

Browse files
committed
Add Docker Compose development environment
Signed-off-by: Tom Duffield <tom@chef.io>
1 parent c0a71e1 commit 52c5119

File tree

7 files changed

+62
-0
lines changed

7 files changed

+62
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.gem
22
*.rbc
33
.bundle
4+
.docker_bundle
45
.config
56
.yardoc
67
Gemfile.lock

Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ruby:2.3
2+
MAINTAINER Tom Duffield <tom@chef.io>
3+
4+
# We need `git` because oftentimes .gemspec depends on it for listing files
5+
RUN apt-get update && \
6+
apt-get install -y git && \
7+
apt-get clean && \
8+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
9+
10+
RUN gem install bundler && mkdir /app
11+
COPY start /start
12+
WORKDIR /app
13+
CMD ["/start"]

Gemfile

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
source "https://rubygems.org"
22

33
gemspec
4+
5+
group :docker do
6+
gem "lita-slack"
7+
gem "guard"
8+
gem "guard-process"
9+
end

Guardfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Because we run Lita in a container, don't connect to STDIN
2+
interactor :off
3+
4+
# Restart the lita CLI anytime we modify the lita_config or a lita file
5+
guard "process", name: "Lita", command: "bundle exec lita" do
6+
watch("lita_config.rb")
7+
watch(%r{^lib/*})
8+
end

docker-compose.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: '3'
2+
services:
3+
lita:
4+
build: .
5+
links:
6+
- redis:redis
7+
volumes:
8+
# Sync all the local code to the app directory
9+
- ./:/app
10+
# Since we are syncing the whole directory, we need to make sure our local `.bundle` directory is not over-written
11+
- ./.docker_bundle:/app/.bundle
12+
environment:
13+
- SLACK_TOKEN
14+
redis:
15+
image: redis

lita_config.rb

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
require "lita/adapters/slack"
2+
3+
Lita.configure do |config|
4+
config.robot.log_level = :debug
5+
config.robot.adapter = :slack
6+
config.robot.admins = ["1"]
7+
8+
# Use the redis host linked via docker-compose
9+
config.redis[:host] = "redis"
10+
11+
config.adapters.slack.token = ENV["SLACK_TOKEN"]
12+
end

start

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
# This file is intended for use only in the Docker environment. If you wish to run Expeditor locally, please run
3+
# bundle exec lita
4+
5+
bundle install --path /var/bundle --jobs $(nproc) --clean
6+
7+
exec bundle exec guard

0 commit comments

Comments
 (0)