Skip to content

Commit

Permalink
Build docker image from ruby:2.3-alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
adammcmaster committed Mar 2, 2016
1 parent cdf8eb6 commit 2b62937
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
FROM zooniverse/ruby:2.3
FROM ruby:2.3-alpine

WORKDIR /rails_app

RUN apt-get update && \
apt-get install --no-install-recommends -y git curl supervisor libpq-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apk add --no-cache git curl supervisor libxml2 libxslt libpq nodejs

RUN mkdir config && curl "https://ip-ranges.amazonaws.com/ip-ranges.json" > config/aws_ips.json

ADD ./Gemfile /rails_app/
ADD ./Gemfile.lock /rails_app/

RUN bundle install --without development test
RUN apk add --no-cache --virtual bundle-build \
libxml2-dev libxslt-dev postgresql-dev build-base && \
bundle config build.nokogiri --use-system-libraries && \
bundle config build.therubyracer --use-system-libraries && \
bundle install --without development test && \
apk del bundle-build

ADD supervisord.conf /etc/supervisor/conf.d/panoptes.conf
ADD supervisord.conf /etc/supervisor.d/panoptes.ini
ADD ./ /rails_app

RUN (cd /rails_app && git log --format="%H" -n 1 > commit_id.txt && rm -rf .git)
Expand Down
4 changes: 2 additions & 2 deletions scripts/docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -ex
#!/bin/sh -ex

cd /rails_app

Expand Down Expand Up @@ -30,5 +30,5 @@ else
cp commit_id.txt public/
fi

exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
exec /usr/bin/supervisord -c /etc/supervisord.conf
fi

0 comments on commit 2b62937

Please sign in to comment.