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

New dockerfile #1

Closed
wants to merge 5 commits 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
57 changes: 48 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,50 @@
FROM rails:4.2.5

RUN \
curl -LOs https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 && \
tar xjf phantomjs-1.9.8-linux-x86_64.tar.bz2 && \
cp phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/local/bin/ && \
rm -r phantomjs-1.9.8-linux-x86_64 phantomjs-1.9.8-linux-x86_64.tar.bz2 && \
curl -LOs http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz && \
gunzip GeoLiteCity.dat.gz && \
FROM ruby:2.3-alpine

# mariadb-dev is a big package (226MB). It is required to compile mysql2 gem

RUN apk update && \
apk upgrade && \
apk add --no-cache \
bash \
build-base \
ca-certificates \
curl \
curl-dev \
geoip-dev \
git \
grep \
libxml2 \
linux-headers \
mariadb-dev \
mariadb-client \
nodejs \
ruby-dev \
tzdata \
wget \
&& rm -rf /var/cache/apk/* \
&& update-ca-certificates

ARG phantom_file=phantomjs-2.1.1-linux-x86_64
RUN wget -q https://bitbucket.org/ariya/phantomjs/downloads/${phantom_file}.tar.bz2 && \
tar -xjf ${phantom_file}.tar.bz2 && \
cp $phantom_file/bin/phantomjs /usr/local/bin && \
rm -rf ${phantom_file} ${phantom_file}.tar.bz2

ARG geolite_file=GeoLiteCity.dat.gz
RUN wget -q http://geolite.maxmind.com/download/geoip/database/${geolite_file} && \
gunzip ${geolite_file} && \
mkdir -p /usr/share/GeoIP/ && \
mv GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat

ENV APP=/iqapp
ENV DOCKER=true
RUN mkdir -p $APP
# Need to set /iqapp to read write so the sync tool can work
RUN chmod a+rw $APP
WORKDIR $APP

ENV BUNDLE_GEMFILE=${APP}/Gemfile \
BUNDLE_JOBS=8 \
BUNDLE_PATH=/bundle

RUN gem install bundler
11 changes: 11 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

BUILDFLAGS="$@"

echo "Building rails image"
IMAGE="inquicker/rails-dev:latest"
# IMAGE="mrinterweb/iq-rails:latest"

docker build $BUILDFLAGS -t $IMAGE .
docker push $IMAGE