LoginSignup
1
1

More than 5 years have passed since last update.

PotmumをDockerで導入しようとしている

Posted at
Dockerfile
FROM centos

# 何か知らんが色々 
RUN yum -y install gcc gcc-c++  autoconf automake kernel-devel ncurses-devel gettext zlib-devel curl-devel wget unzip make perl perl-devel perl-ExtUtils-MakeMaker which bzip2 postgresql postgresql-devel less libxml2 libxslt libiconv sqlite-devel libxml2-devel libxslt-devel libiconv-devel openssl openssl-devel

# 最新のgitを使いたいだけ
RUN wget https://github.com/git/git/archive/master.zip && unzip master
WORKDIR git-master/
RUN autoconf && ./configure --prefix=/usr/local --with-curl=/usr/local --with-expat && make all && make install

# rbenv使いたいだけ
RUN git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
RUN git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
RUN echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
RUN echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
RUN yum -y install openssl-devel readline-devel
RUN /bin/bash -l -c "rbenv install 2.3.1"
RUN /bin/bash -l -c "rbenv global 2.3.1"

# bundler 設定したい
WORKDIR ../
RUN /bin/bash -l -c "gem install bundler"
RUN /bin/bash -l -c "bundle config build.nokogiri --use-system-libraries"

# node使いたいだけ
RUN wget https://nodejs.org/dist/v4.5.0/node-v4.5.0.tar.gz
RUN tar zxvf node-v4.5.0.tar.gz
WORKDIR node-v4.5.0
RUN ./configure && make && make install

# ようやくpotmumのインストール
WORKDIR ../
RUN /bin/bash -l -c "bundle config github.https true"
RUN git clone https://github.com/rutan/potmum
WORKDIR potmum
RUN /bin/bash -l -c "bundle install --path vendor/bundle"
RUN /bin/bash -l -c "bundle exec rake assets:precompile assets:environment db:create db:migrate"
CMD ["bash","-l"]

メモ

  • export USE_GITHUB=1 (TRUEとかではない)
  • export GITHUB_KEY=(GitHubから得る)
  • export GITHUB_SECRET=(GitHubから得る)

todo

  • サーバとして動くような docker run
  • postgresql関係の設定放置してるので何かいじる
  • ログインするためにGitHubの認証使う設定とか
1
1
0

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
1
1