FROM ruby:2.1.2
MAINTAINER Mark McDonnell <mark.mcdonnell@bbc.co.uk>
LABEL uk.co.bbci.api.mozart="true"
RUN mkdir /app
WORKDIR /app
ADD src/Gemfile /app/Gemfile
RUN bundle install --retry 10 --jobs 4
EXPOSE 9292
docker-bootstrap-app.sh
#!/bin/bash
a=$(bundle check)
b="The Gemfile's dependencies are satisfied"
if [ "$a" != "$b" ]; then
# building the image locally on a poor network
# can result in gems not being installed
bundle install --retry 10
fi
bundle exec sequel -E -m db/migrations/ postgres://$(echo "postgres:$DB_ENV_POSTGRES_PASSWORD@$DB_PORT_5432_TCP_ADDR:$DB_PORT_5432_TCP_PORT/$DB_ENV_POSTGRES_DB")
bundle exec rackup config.ru -p 9292 -o 0.0.0.0