Created
December 9, 2015 17:42
-
-
Save zarembas/3807179536318d64b3d5 to your computer and use it in GitHub Desktop.
Docker Rails
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
db: | |
image: postgres:9.4.5 | |
ports: | |
- "5432:5432" | |
container_name: | |
demo-db | |
web: | |
build: . | |
ports: | |
- "3000:3000" | |
volumes: | |
- .:/var/www | |
container_name: | |
demo-web | |
links: | |
- db | |
environment: | |
RAILS_ENV: development |
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
FROM ubuntu | |
ENV RAILS_PORT 3000 | |
ENV RAILS_ENV "${APP_ENV}" | |
ENV RAILS_ROOT "/var/www" | |
RUN apt-get update && \ | |
apt-get install -yq \ | |
git-core \ | |
curl \ | |
zlib1g-dev \ | |
build-essential \ | |
libssl-dev \ | |
libreadline-dev \ | |
libyaml-dev \ | |
libsqlite3-dev \ | |
sqlite3 \ | |
libxml2-dev \ | |
libxslt1-dev \ | |
libcurl4-openssl-dev \ | |
python-software-properties \ | |
libffi-dev \ | |
libpq-dev \ | |
&& \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
RUN wget http://ftp.ruby-lang.org/pub/ruby/2.2/ruby-2.2.3.tar.gz && \ | |
tar -xzvf ./ruby-2.2.3.tar.gz && \ | |
rm -rf ./ruby-2.2.3.tar.gz && \ | |
cd ./ruby-2.2.3/ && \ | |
./configure && \ | |
make && \ | |
sudo make install | |
RUN echo "gem: --no-ri --no-rdoc" > ~/.gemrc && \ | |
gem install bundler && \ | |
gem install rails -v 4.2.5 && \ | |
mkdir -p ${RAILS_ROOT} && \ | |
rails new ${RAILS_ROOT} | |
WORKDIR ${RAILS_ROOT} | |
ADD Gemfile /${RAILS_ROOT}/Gemfile | |
ADD Gemfile.lock /${RAILS_ROOT}/Gemfile.lock | |
RUN bundle install | |
ADD . /${RAILS_ROOT} | |
EXPOSE ${RAILS_PORT} | |
CMD ["rails", "server", "-b", "0.0.0.0"] |
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
FROM ubuntu:14.04 | |
ENV DEBIAN_FRONTEND "noninteractive" | |
RUN apt-get update && \ | |
apt-get install -yq vim nano git wget curl zip && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment