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

Dockerfile from UBI image and Space after navbar #100

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
43 changes: 13 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,47 +1,30 @@
FROM centos
FROM registry.redhat.io/ubi8/ruby-27:1-95

LABEL io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \
io.s2i.scripts-url="image:///usr/libexec/s2i"

RUN curl -sL -o /etc/yum.repos.d/centos-essentials.repo https://gist.githubusercontent.com/marekjelen/c08a3c3a548820144f2da01d2bad6279/raw/centos-essentials.repo
ENV PATH=/opt/essentials/bin:$PATH

RUN yum update -y && \
yum install --setopt=tsflags=nodocs -y essentials-ruby bundler \
gcc gcc-c++ libxml2-devel sqlite-devel git && \
yum clean all && \
rm -rf /var/cache/yum

RUN gem update --system --no-document && \
gem update bundler --no-document

RUN mkdir -p /usr/libexec/s2i

COPY s2i/assemble s2i/run /usr/libexec/s2i/

RUN chmod 777 /usr/libexec/s2i/{assemble,run}
USER root

ENV RAILS_ENV=production
ENV HOME=/workshopper

RUN useradd -u 1001 -g 0 -M -d /workshopper workshopper
RUN mkdir -p /workshopper \
&& chown default:root /workshopper \
&& chmod 777 /workshopper

RUN mkdir -p /workshopper && chown workshopper:root /workshopper && chmod 777 /workshopper
USER default

USER workshopper
WORKDIR /workshopper

ADD --chown=workshopper:root Gemfile Gemfile.lock ./
ADD --chown=default:root Gemfile Gemfile.lock ./

RUN bundle lock --add-platform x86_64-linux && \
bundle config set --local deployment 'true' && \
bundle install

RUN bundle install --deployment

ADD --chown=workshopper:root . .
ADD --chown=default:root . .

RUN bundle exec rake assets:precompile

RUN rm -rf tmp log && mkdir -p tmp log && chmod -R 0777 tmp log
ENV HOME=/workshopper

EXPOSE 8080

CMD ./boot.sh
CMD ./boot.sh
16 changes: 16 additions & 0 deletions DockerfileToGenerateGemfile_lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM registry.redhat.io/ubi8/ruby-27:1-95

USER root

ENV RAILS_ENV=production
ENV HOME=/workshopper

RUN mkdir -p /workshopper \
&& chown default:root /workshopper \
&& chmod 777 /workshopper

USER default
WORKDIR /workshopper

ADD --chown=default:root Gemfile ./
RUN bundle lock --add-platform x86_64-linux
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ platforms :jruby do
gem 'activerecord-jdbcsqlite3-adapter'
end

source 'https://rails-assets.org' do
gem 'rails-assets-chartjs'
end
gem 'rails-assets-chartjs', '2.1.1', source: 'https://rails-assets.org'

group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
Expand Down
Loading