diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..01aa97f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM ruby:2.3.0 + +ENV WORKER_PROCESSES 4 +ENV DATABASE_URL postgres://postgres:mysecretpassword@postgres/fixer +ENV VERSION 1 + +RUN mkdir /fixer-io +WORKDIR /fixer-io +ADD Gemfile /fixer-io/Gemfile +ADD Gemfile.lock /fixer-io/Gemfile.lock +RUN bundle install --deployment --without development:test +ADD . /fixer-io + +EXPOSE 8080 + +CMD bundle exec unicorn -p 8080 -c /fixer-io/config/unicorn.rb diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c9d7159 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: '2' +services: + postgres: + image: postgres + ports: + - 5432:5432 + environment: + - POSTGRES_DB=fixer + fixer: + build: . + command: bundle exec unicorn -p 8080 -c /fixer-io/config/unicorn.rb + volumes: + - .:/fixer-io + ports: + - 8080:8080 + environment: + - RACK_ENV=production + - DATABASE_URL=postgres://postgres:mysecretpassword@postgres/fixer + depends_on: + - postgres