Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Build docker image from ruby:2.3-alpine #1695

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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