mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-10-29 23:32:35 +01:00
Merge pull request #19 from 0x46616c6b/dockerfile
add dockerfile and docker-compose.yml
This commit is contained in:
commit
51c315f949
16
Dockerfile
Normal file
16
Dockerfile
Normal 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
|
13
README.md
13
README.md
@ -1,3 +1,5 @@
|
||||
# Fixer.io
|
||||
|
||||
[![Travis](https://travis-ci.org/hakanensari/fixer-io.svg)](https://travis-ci.org/hakanensari/fixer-io)
|
||||
|
||||
<img src="http://fixer.io/img/money.png" alt="fixer" width=180 align="middle">
|
||||
@ -5,3 +7,14 @@
|
||||
Fixer.io is a free JSON API for current and historical foreign exchange rates published by the European Central Bank.
|
||||
|
||||
The rates are updated daily around 3PM CET.
|
||||
|
||||
|
||||
## Docker
|
||||
|
||||
|
||||
```
|
||||
# bring the stack up
|
||||
docker-compose up -d
|
||||
# initialize the database (postgres need a short time to come up)
|
||||
docker-compose run fixer rake db:migrate rates:load
|
||||
```
|
||||
|
20
docker-compose.yml
Normal file
20
docker-compose.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user