From 30b49ac5deb0c6631cd64d8dc253e70aa2df1425 Mon Sep 17 00:00:00 2001 From: Paul Buzuloiu Date: Tue, 29 Jan 2019 08:29:20 -0500 Subject: [PATCH] add-docker --- Dockerfile | 13 +++++++++++++ config/database.yml | 2 ++ docker-compose.yml | 17 +++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..99cfd86 --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/config/database.yml b/config/database.yml index 157a2d6..d893f92 100644 --- a/config/database.yml +++ b/config/database.yml @@ -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 } %> diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..793daa5 --- /dev/null +++ b/docker-compose.yml @@ -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