-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile for modyo-7 and modyo-8 aws_ec2 app builds
- Loading branch information
Showing
2 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|