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 FROM ruby:2.3.0
ENV WORKER_PROCESSES 4 RUN mkdir /app
ENV DATABASE_URL postgres://postgres:mysecretpassword@postgres/fixer WORKDIR /app
ENV VERSION 1 ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN mkdir /fixer-io RUN bundle install --without development test
WORKDIR /fixer-io ADD . /app
ADD Gemfile /fixer-io/Gemfile CMD bundle exec unicorn -c /app/config/unicorn.rb
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

View File

@ -1,20 +1,17 @@
version: '2' version: '2'
services: services:
postgres: db:
image: postgres image: postgres
ports: ports:
- 5432:5432 - 5432:5432
environment: web:
- POSTGRES_DB=fixer
fixer:
build: . build: .
command: bundle exec unicorn -p 8080 -c /fixer-io/config/unicorn.rb
volumes: volumes:
- .:/fixer-io - .:/app
ports: ports:
- 8080:8080 - 8080:8080
environment: environment:
- RACK_ENV=production - RACK_ENV=production
- DATABASE_URL=postgres://postgres:mysecretpassword@postgres/fixer - DATABASE_URL=postgres://postgres@db/postgres
depends_on: links:
- postgres - db