Skip to content

Commit

Permalink
add-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
buzuloiu committed Jan 29, 2019
1 parent 6093d50 commit 30b49ac
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ruby:2.6.0

RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs

RUN mkdir /shopify-2019
WORKDIR /shopify-2019

COPY Gemfile /shopify-2019/Gemfile
COPY Gemfile.lock /shopify-2019/Gemfile.lock

RUN bundle install

COPY . /shopify-2019
2 changes: 2 additions & 0 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
default: &default
adapter: postgresql
encoding: unicode
host: db
username: postgres
# For details on connection pooling, see Rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'
services:
db:
image: postgres:9.6
ports:
- "5432"
volumes:
- ./tmp/db:/var/lib/postgresql/data
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/shopify-2019
ports:
- "3000:3000"
depends_on:
- db

0 comments on commit 30b49ac

Please sign in to comment.