Skip to content

Commit

Permalink
Add Dockerfile for modyo-7 and modyo-8 aws_ec2 app builds
Browse files Browse the repository at this point in the history
  • Loading branch information
econtrer committed Oct 16, 2017
1 parent f6786b5 commit 51ff173
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
45 changes: 45 additions & 0 deletions 7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM jruby:1.7.27

# Change packages source to cloudfront
RUN sed 's@deb.debian.org@cloudfront.debian.net@' -i /etc/apt/sources.list
RUN sed 's@security.debian.org@cloudfront.debian.net/debian-security@' -i /etc/apt/sources.list
RUN export DEBIAN_VERSION=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release) && sed 's@deb.debian.org@cloudfront.debian.net@' -i /etc/apt/sources.list.d/${DEBIAN_VERSION}-backports.list || echo 'Missing ${DEBIAN_VERSION}-backports.list file. Skipping'

# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential
RUN apt-get install -y git

# Install Zip.
RUN apt-get install zip

# Install node js.
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get install -y nodejs

RUN apt-get dist-upgrade -y
RUN apt-get install imagemagick -y

# Docker image won't build on Teamcity without this
ENV TERM=xterm

ENV BUILD_NUMBER $BUILD_NUMBER
ENV RAILS_ENV ${RAILS_ENV:-staging} # staging is the default if no environment is set
ENV SSH_AUTH_SOCK $SSH_AUTH_SOCK
ENV CLIENT_PREFIX $APP_PREFIX
ENV CLIENT_TOKEN $CLIENT_TOKEN
ENV ARTIFACTORY_USER $ARTIFACTORY_USER
ENV ARTIFACTORY_KEY $ARTIFACTORY_KEY

# Jruby opts for increased memory
ENV JRUBY_OPTS '-J-client -J-Xss2m -J-Xms1536m -J-Xmx1536m -J-XX:+CMSClassUnloadingEnabled -J-XX:+UseConcMarkSweepGC'

# Set an environment variable where the Rails app is installed to inside of Docker image:
ENV RAILS_ROOT /var/www/modyo
RUN mkdir -p $RAILS_ROOT

# Set working directory, where the commands will be ran:
WORKDIR $RAILS_ROOT

# Force .bundle folder creation inside project
ENV BUNDLE_APP_CONFIG './.bundle'

48 changes: 48 additions & 0 deletions 8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM jruby:9.1.9.0

# Change packages source to cloudfront
RUN sed 's@deb.debian.org@cloudfront.debian.net@' -i /etc/apt/sources.list
RUN sed 's@security.debian.org@cloudfront.debian.net/debian-security@' -i /etc/apt/sources.list
RUN export DEBIAN_VERSION=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release) && sed 's@deb.debian.org@cloudfront.debian.net@' -i /etc/apt/sources.list.d/${DEBIAN_VERSION}-backports.list || echo 'Missing ${DEBIAN_VERSION}-backports.list file. Skipping'

# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential

# Install Zip.
RUN apt-get install zip

# Install node js.
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get install -y nodejs

RUN apt-get dist-upgrade -y
RUN apt-get install ImageMagick -y
RUN apt-get install libicu-dev -y
RUN apt-get install netcat -y

# Install Amazon AWS-CLI
RUN apt-get -y install python-dev
RUN apt-get -y install python-pip
RUN pip install awscli

# Install Docker
RUN curl -sSL https://get.docker.com/ | sh

# Mariadb asks for this constant to be defined.
ENV TERM=xterm

# Build number, defined by Teamcity
ENV BUILD_NUMBER ${BUILD_NUMBER}
ENV SSH_AUTH_SOCK $SSH_AUTH_SOCK

# Set an environment variable where the Rails app is installed to inside of Docker image:
ENV RAILS_ROOT /var/www/modyo
ENV RAILS_ENV=production
RUN mkdir -p $RAILS_ROOT

# JRUBY OPTIONS.
ENV JRUBY_OPTS='-J-Xss1m -J-Xms2048m -J-Xmx2048m --1.9 -J-XX:ReservedCodeCacheSize=128m -J-XX:+CMSClassUnloadingEnabled -J-XX:+UseConcMarkSweepGC'

# Set working directory, where the commands will be ran:
WORKDIR $RAILS_ROOT

0 comments on commit 51ff173

Please sign in to comment.