Created
January 22, 2018 23:22
-
-
Save naderio/2eee22118e641fb741e56f1ca2826fe6 to your computer and use it in GitHub Desktop.
Ruby on Rails Docker Development Setup
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
version: '2.3' | |
services: | |
postgres: | |
image: postgres:9.6 | |
hostname: postgres | |
ports: | |
- "5432:5432" | |
volumes: | |
- "./tmp:/var/lib/postgresql/data" | |
environment: | |
POSTGRES_USER: placeholder | |
POSTGRES_PASSWORD: placeholder | |
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
version: '2.3' | |
services: | |
placeholder-app: | |
build: . | |
container_name: placeholder-app | |
hostname: placeholder-app | |
ports: | |
- "3000:80" | |
volumes: | |
- .:/app | |
environment: | |
- RAILS_ENV=development | |
- DATABASE_URL=postgres://placeholder:placeholder@172.17.0.1 | |
- MAIL_URL=smtp://172.17.0.1:1025 # @TODO support | |
- ROOT_URL=http://localhost:3000 # @TODO support |
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 ruby:2.4.3 | |
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev graphviz | |
RUN mkdir /app | |
WORKDIR /app | |
COPY . /app | |
RUN bundle install | |
ENV PORT=80 | |
EXPOSE $PORT | |
CMD bin/rails server -b '0.0.0.0' -p $PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment