-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from showwin/docker-ruby
Add Docker env for Ruby version
- Loading branch information
Showing
8 changed files
with
40 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
ARG BASE_IMAGE=ishocon2-app-base:latest | ||
FROM ${BASE_IMAGE} | ||
|
||
ENV RUBY_VERSION=2.7.1 | ||
|
||
# Ruby のインストール | ||
RUN sudo apt-get update && \ | ||
sudo apt-get install -y ruby-dev libmysqlclient-dev libffi-dev libyaml-dev bzip2 && \ | ||
sudo apt-get clean && \ | ||
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | ||
RUN PATH="$HOME/.rbenv/bin:$PATH" && \ | ||
eval "$(rbenv init -)" && \ | ||
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build && \ | ||
rbenv install $RUBY_VERSION && rbenv rehash && rbenv global $RUBY_VERSION | ||
|
||
# アプリケーション | ||
COPY --chown=ishocon:ishocon webapp/ /home/ishocon/webapp | ||
|
||
WORKDIR /home/ishocon | ||
|
||
RUN sudo gem install bundler -v "1.16.1" && \ | ||
cd webapp/ruby && \ | ||
. /home/ishocon/.bashrc && \ | ||
bundle install | ||
|
||
COPY run.sh /home/ishocon/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
worker_processes 4 | ||
preload_app true | ||
pid './unicorn.pid' | ||
pid '/tmp/unicorn.pid' | ||
listen 8080 |