Skip to content

Commit

Permalink
Use docker to install the dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
takuti committed Jan 17, 2018
1 parent 77ed5d3 commit c089553
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
@@ -0,0 +1,3 @@
scripts
ipadic
tweet.markov
12 changes: 8 additions & 4 deletions .travis.yml
@@ -1,11 +1,15 @@
sudo: required

services:
- docker

language: ruby

rvm:
- 2.4.0
before_install:
- docker build -t takuti/twitter-bot .

script:
- bundle exec rake setup
- bundle exec rake
- docker run -it takuti/twitter-bot /bin/sh -c "bundle exec rake"

branches:
only:
Expand Down
20 changes: 20 additions & 0 deletions Dockerfile
@@ -0,0 +1,20 @@
FROM ruby:2.5.0-alpine

ENV APP_ROOT='/src/github.com/takuti/twitter-bot'

ADD . ${APP_ROOT}
WORKDIR ${APP_ROOT}

RUN apk update && \
apk add --no-cache --virtual .builddeps ca-certificates wget openjdk7-jre build-base libxml2-dev libxslt-dev && \
update-ca-certificates && \
wget 'http://osdn.jp/frs/redir.php?m=jaist&f=%2Figo%2F52344%2Figo-0.4.3.jar' -O igo.jar && \
wget 'https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7MWVlSDBCSXZMTXM' -O mecab-ipadic.tar.gz && \
tar zxfv mecab-ipadic.tar.gz && \
java -cp igo.jar net.reduls.igo.bin.BuildDic ipadic mecab-ipadic-2.7.0-20070801 EUC-JP && \
rm -rf igo.jar mecab-ipadic-2.7.0-20070801 mecab-ipadic.tar.gz && \
bundle install && \
apk del .builddeps

EXPOSE 80
CMD ["bundle", "exec", "rackup", "config.ru", "-p", "80", "-o", "0.0.0.0"]

0 comments on commit c089553

Please sign in to comment.