Simplify Docker files

This commit is contained in:
Hakan Ensari 2016-04-11 14:28:22 +01:00
parent d7b6e8c898
commit 1158b6ffee
2 changed files with 13 additions and 23 deletions

View File

@ -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

View File

@ -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