LoginSignup
7
4

More than 5 years have passed since last update.

togelack (slack + togetter みたいなやつ) を docker で動かしてみた

Last updated at Posted at 2017-01-16

togelack が便利そうだったので、docker で動かしてみたメモ。

clone してディレクトリに入る。

$ git clone https://github.com/rutan/togelack.git
$ cd togelack

Dockerfile 作成。

$ vi Dockerfile
FROM ruby:2.2.4
WORKDIR /user/src/app
COPY Gemfile* ./
RUN bundle install
COPY . .
RUN rake assets:precompile
CMD bundle exec puma -C config/puma.rb

docker-compose.yml 作成。

$ vi docker-compose.yml

version: "2"
services:
  mongo:
    image: mongo
  app:
    build: .
    ports:
      - 3000:3000
    environment:
      SECRET_KEY_BASE: ${セキュアでランダムな文字列}
      RAILS_ENV: production
      MONGOID_ENV: production
      SLACK_TOKEN: ${あなたの SLACK TOKEN}
      SLACK_CLIENT_ID: ${あなたの SLACK CLIENT ID}
      SLACK_CLIENT_SECRET: ${あなたの SLACK CLIENT SECRET}
      SLACK_TEAM_ID: ${あなたの SLACK TEAM ID}
      SLACK_TEAM_NAME: ${あなたの SLACK TEAM NAME}
      MONGO_URL: mongodb://mongo:27017/togelack
    restart: always

ドッカーコンポーザップディー。

$ docker-compose up -d
Starting togelack_mongo_1
Recreating togelack_app_1

これだけで http://localhost:3000 に togelack が立ち上がった。シンプルで使いやすく便利そう。

Dockerfile と docker-compose.yml プルリクしてみようかな…。

参考資料

7
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
4