forked from External/greenlight
GRN2-XX: updates to github actions for building and publishing alternate images (#2932)
* rework on scripts for git actions * updated ruby version * updated alternate filter * removed ci settings brought forom sl ci * added prefix to image tag and version_code * fixed alternate dockerfile for alpine * updates for amazonlinux alternate image * added missing variables to ci scripts * update of tag in alternate images on release
This commit is contained in:
46
dockerfiles/v2/amazonlinux
Normal file
46
dockerfiles/v2/amazonlinux
Normal file
@ -0,0 +1,46 @@
|
||||
FROM amazonlinux:2.0.20210813.1 AS amazonlinux
|
||||
|
||||
ARG RAILS_ROOT=/usr/src/app
|
||||
ENV RAILS_ROOT=${RAILS_ROOT}
|
||||
|
||||
FROM amazonlinux AS amazonlinux-base
|
||||
ENV TINI_VERSION v0.19.0
|
||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
|
||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
|
||||
RUN gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7
|
||||
RUN gpg --batch --verify /tini.asc /sbin/tini
|
||||
RUN chmod +x /sbin/tini
|
||||
RUN yum -y install redhat-rpm-config
|
||||
|
||||
FROM amazonlinux-base AS base
|
||||
WORKDIR $RAILS_ROOT
|
||||
# Install Node.js (needed for yarn)
|
||||
RUN yum -y install gcc-c++ make
|
||||
RUN curl -sL https://rpm.nodesource.com/setup_16.x | bash -
|
||||
RUN yum -y install nodejs
|
||||
# Install Ruby & Rails
|
||||
RUN curl -sL -o /etc/yum.repos.d/yarn.repo https://dl.yarnpkg.com/rpm/yarn.repo
|
||||
RUN amazon-linux-extras enable ruby2.6 \
|
||||
&& yum -y install git tar gzip yarn shared-mime-info libxslt zlib-devel sqlite-devel mariadb-devel postgresql-devel ruby-devel rubygems-devel rubygem-bundler rubygem-io-console rubygem-irb rubygem-json rubygem-minitest rubygem-net-http-persistent rubygem-net-telnet rubygem-power_assert rubygem-rake rubygem-test-unit rubygem-thor rubygem-xmlrpc rubygem-bigdecimal \
|
||||
&& gem install rails
|
||||
RUN yum -y install python3 python3-pip shadow-utils
|
||||
|
||||
FROM base as builder
|
||||
COPY Gemfile* ./
|
||||
RUN bundle config build.nokogiri --use-system-libraries \
|
||||
&& bundle install --deployment --without development:test -j4 \
|
||||
&& rm -rf vendor/bundle/ruby/*/cache \
|
||||
&& find vendor/bundle/ruby/*/gems/ \( -name '*.c' -o -name '*.o' \) -delete
|
||||
COPY . ./
|
||||
|
||||
FROM base
|
||||
ENV RAILS_ENV=production RAILS_LOG_TO_STDOUT=true
|
||||
|
||||
ARG VERSION_CODE
|
||||
ENV VERSION_CODE=${VERSION_CODE}
|
||||
|
||||
COPY --from=builder $RAILS_ROOT $RAILS_ROOT
|
||||
|
||||
EXPOSE 80
|
||||
RUN chmod +x bin/start
|
||||
CMD [ "bin/start" ]
|
Reference in New Issue
Block a user