From 1158b6ffeeef520b9ed8d6ae6d35abc2be72acae Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Mon, 11 Apr 2016 14:28:22 +0100 Subject: [PATCH] Simplify Docker files --- Dockerfile | 21 +++++++-------------- docker-compose.yml | 15 ++++++--------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 01aa97f..0a1f81f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,9 @@ 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 +RUN mkdir /app +WORKDIR /app +ADD Gemfile /app/Gemfile +ADD Gemfile.lock /app/Gemfile.lock +RUN bundle install --without development test +ADD . /app +CMD bundle exec unicorn -c /app/config/unicorn.rb diff --git a/docker-compose.yml b/docker-compose.yml index c9d7159..235697a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,20 +1,17 @@ version: '2' services: - postgres: + db: image: postgres ports: - 5432:5432 - environment: - - POSTGRES_DB=fixer - fixer: + web: build: . - command: bundle exec unicorn -p 8080 -c /fixer-io/config/unicorn.rb volumes: - - .:/fixer-io + - .:/app ports: - 8080:8080 environment: - RACK_ENV=production - - DATABASE_URL=postgres://postgres:mysecretpassword@postgres/fixer - depends_on: - - postgres + - DATABASE_URL=postgres://postgres@db/postgres + links: + - db