-
-
Save udkumar/4c0aa11fddc6c77cd5b3142b1fcb7ec2 to your computer and use it in GitHub Desktop.
Docker + Rails + Redis + Postgres
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
# base on latest ruby base image | |
FROM ruby:latest | |
# update and install dependencies | |
RUN apt-get update -qq | |
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential libpq-dev nodejs apt-utils postgresql-client | |
# setup app folders | |
RUN mkdir /sample | |
WORKDIR /sample | |
# copy over Gemfile and install bundle | |
ADD Gemfile /sample/Gemfile | |
ADD Gemfile.lock /sample/Gemfile.lock | |
RUN bundle install | |
# copy over remaining app files | |
ADD . /sample | |
# Run | |
EXPOSE 3000 | |
CMD ["rails", "server"] |
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 | |
ports: | |
- "5432" | |
redis: | |
image: redis:2.8.19 | |
ports: | |
- 6379:6379 | |
web: | |
build: . | |
#command: bundle exec rails server -p 3000 | |
command: bundle exec unicorn -p 3000 -c ./config/unicorn.rb | |
volumes: | |
- .:/sample | |
ports: | |
- 3000:3000 | |
links: | |
- db | |
- redis |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment