add dockerfile and docker-compose.yml

This commit is contained in:
louis 2016-04-06 00:49:19 +02:00
parent e109c5b7ed
commit 3977ced331
2 changed files with 36 additions and 0 deletions

16
Dockerfile Normal file
View File

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

20
docker-compose.yml Normal file
View File

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