Created
November 27, 2019 11:06
-
-
Save shqear93/930920fb2d578bfc6c109fc45d2bedb5 to your computer and use it in GitHub Desktop.
Ruby 2.4.4 slim-jessie Dockerfile
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
FROM ruby:2.4.4-slim-jessie | |
RUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/* | |
RUN wget --no-check-certificate --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - | |
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/PostgreSQL.list | |
RUN apt-get update && \ | |
apt-get install -y build-essential libpq-dev git nodejs \ | |
file postgresql-client-10 locales imagemagick --no-install-recommends \ | |
&& apt-get clean \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Set Timezone & Locales | |
ENV TZ=Asia/Amman | |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
RUN dpkg-reconfigure -f noninteractive tzdata && \ | |
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ | |
sed -i -e 's/# ar_JO.ISO-8859-6 ISO-8859-6/ar_JO.ISO-8859-6 ISO-8859-6/' /etc/locale.gen && \ | |
echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \ | |
dpkg-reconfigure --frontend=noninteractive locales && \ | |
update-locale LANG=en_US.UTF-8 | |
# Upgrade bundle and RubyGems | |
RUN gem install rubygems-update && update_rubygems && gem update --system | |
ENV BUNDLER_VERSION 2.0.2 | |
RUN gem install bundler -v 2.0.2 | |
# Install rails 5.1.3 | |
RUN gem install sprockets -v 3.7.2 && gem install rails -v 5.1.3 | |
# Install semaphore rspec boosters | |
RUN gem install semaphore_test_boosters && touch /usr/bin/http && chmod +x /usr/bin/http | |
# Bitbucket SSH authentication | |
#COPY ssh/* /root/.ssh/ | |
#RUN chmod 600 /root/.ssh/id_rsa && chmod 600 /root/.ssh/id_rsa.pub | |
# Work directory | |
RUN mkdir /myapp && mkdir /myapp/log && mkdir -p /myapp/tmp/pids | |
WORKDIR /myapp | |
ENV PATH="/myapp/bin:${PATH}" | |
# pull the requested branch - no caching | |
#ARG CACHEBUST=1 | |
#ARG BRANCH_NAME=production | |
#RUN git archive --remote=git@bitbucket.org:boundlessdrop/el-ciclo.git ${BRANCH_NAME} | tar -x | |
# Copy source code | |
ARG CACHEBUST=1 | |
ARG SRC='' | |
COPY ${SRC} . | |
# Install gems | |
RUN bundle install --jobs 50 --retry 5 --without development | |
# Prepare project files | |
#RUN cp config/database.yml.sample config/database.yml | |
# Entrypoint | |
COPY docker/entrypoint /usr/bin/entrypoint | |
RUN chmod +x /usr/bin/entrypoint | |
ENTRYPOINT ["sh", "/usr/bin/entrypoint"] | |
CMD ["bash"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment