2019-03-18 23:27:01 -03:00
|
|
|
FROM opensuse/leap:15 as base
|
|
|
|
|
|
|
|
|
|
# Import google packaging key for chrome
|
|
|
|
|
COPY google-packaging.key /tmp
|
|
|
|
|
RUN rpm --import /tmp/google-packaging.key
|
|
|
|
|
|
|
|
|
|
# Enable/Disable the repositories we need/don't need
|
|
|
|
|
RUN zypper rr openSUSE-Leap-15.0-Non-Oss openSUSE-Leap-15.0-Update-Non-Oss; \
|
|
|
|
|
zypper ar -f https://download.opensuse.org/repositories/devel:/tools/openSUSE_Leap_15.0/devel:tools.repo; \
|
|
|
|
|
zypper ar -f http://dl.google.com/linux/chrome/rpm/stable/x86_64 google-chrome; \
|
|
|
|
|
zypper --gpg-auto-import-keys refresh
|
|
|
|
|
|
|
|
|
|
# Install our requirements
|
|
|
|
|
RUN zypper -n install --no-recommends \
|
|
|
|
|
# for compiling assets/gems
|
|
|
|
|
nodejs8 gcc-c++ git-core make \
|
|
|
|
|
# for ...
|
|
|
|
|
ImageMagick \
|
|
|
|
|
# for bundler
|
|
|
|
|
sudo \
|
|
|
|
|
# as databases
|
|
|
|
|
libmariadb-devel postgresql-devel sqlite3-devel \
|
|
|
|
|
# for nokogiri
|
|
|
|
|
libxml2-devel libxslt-devel \
|
|
|
|
|
# for the interactive shell
|
|
|
|
|
ack curl wget w3m vim \
|
|
|
|
|
# for running our tests
|
|
|
|
|
phantomjs which \
|
|
|
|
|
# as ruby
|
|
|
|
|
ruby2.5-devel \
|
|
|
|
|
# as browser for feature tests
|
|
|
|
|
google-chrome-stable
|
|
|
|
|
|
|
|
|
|
# Setup sudo
|
|
|
|
|
RUN echo 'osem ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
|
|
|
|
|
|
|
|
|
# Disable versioned gem binary names
|
|
|
|
|
RUN echo 'install: --no-format-executable' >> /etc/gemrc
|
|
|
|
|
|
|
|
|
|
# Install bundler & foreman
|
|
|
|
|
RUN gem install bundler:1.17.3 foreman
|
|
|
|
|
|
|
|
|
|
# Create our user
|
|
|
|
|
RUN useradd -m --user-group osem
|
|
|
|
|
|
|
|
|
|
CMD ["/bin/bash", "-l"]
|
|
|
|
|
|
|
|
|
|
FROM base
|
2018-09-05 22:49:57 +02:00
|
|
|
|
|
|
|
|
# Add our files
|
2019-01-30 01:35:01 +01:00
|
|
|
COPY --chown=1000:1000 . /osem/
|
|
|
|
|
|
2018-09-05 22:49:57 +02:00
|
|
|
USER osem
|
|
|
|
|
WORKDIR /osem/
|
|
|
|
|
|
|
|
|
|
# Install our bundle
|
|
|
|
|
RUN export NOKOGIRI_USE_SYSTEM_LIBRARIES=1; bundle install --jobs=3 --retry=3 --without test development
|
|
|
|
|
|
2019-01-30 01:35:01 +01:00
|
|
|
# Generate assets
|
|
|
|
|
RUN export RAILS_ENV=production; bundle exec rake assets:clobber assets:precompile
|
2018-09-05 22:49:57 +02:00
|
|
|
|
|
|
|
|
ENV RAILS_ENV=production
|
|
|
|
|
|
|
|
|
|
CMD ["foreman", "start"]
|