ensl.org/Dockerfile

39 lines
1 KiB
Text
Raw Normal View History

FROM ruby:2.6.5
ENV RAILS_ENV production
# Add 'web' user which will run the application
RUN adduser web --home /home/web --shell /bin/bash --disabled-password --gecos ""
2020-03-17 01:36:46 +00:00
RUN apt-get update && apt-get -y upgrade \
&& apt-get -y install \
libmariadb-dev libmariadb-dev-compat \
libssl-dev \
zlib1g-dev libreadline-dev libyaml-dev \
libxslt1-dev libxml2-dev \
imagemagick libmagickwand-dev \
nodejs \
phantomjs \
2020-03-17 01:36:46 +00:00
firefox-esr
# Separate Gemfile ADD so that `bundle install` can be cached more effectively
2020-03-17 01:36:46 +00:00
ADD Gemfile Gemfile.lock /var/www/
2020-03-17 01:36:46 +00:00
RUN gem install bundler && \
mkdir -p /var/bundle && chown -R web:web /var/bundle && chown -R web:web /var/www
WORKDIR /var/www
USER web
2020-03-17 01:36:46 +00:00
RUN bundle config github.https true && \
bundle config set path '/var/bundle' && \
bundle install --jobs 8 && \
bundle exec rake assets:precompile
USER root
2020-03-17 01:36:46 +00:00
# Temporary fix for assets
2019-10-09 19:04:09 +00:00
RUN mv /var/www/public/assets /home/web/assets
2020-03-22 13:29:39 +00:00
CMD ["/var/www/bin/script/entry.sh"]