2019-09-24 19:55:34 +00:00
|
|
|
FROM ruby:2.2.10
|
|
|
|
|
|
|
|
ENV RAILS_ENV development
|
|
|
|
|
|
|
|
# Add 'web' user which will run the application
|
|
|
|
RUN adduser web --home /home/web --shell /bin/bash --disabled-password --gecos ""
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get -y upgrade \
|
2019-10-21 22:57:48 +00:00
|
|
|
&& apt-get -y install mysql-client libmysqlclient-dev memcached nodejs firefox-esr \
|
2019-09-24 19:55:34 +00:00
|
|
|
&& service memcached start
|
|
|
|
|
|
|
|
# Separate Gemfile ADD so that `bundle install` can be cached more effectively
|
|
|
|
|
|
|
|
ADD Gemfile Gemfile.lock /var/www/
|
|
|
|
|
|
|
|
RUN mkdir -p /var/bundle && chown -R web:web /var/bundle && chown -R web:web /var/www
|
|
|
|
RUN su -c "bundle config github.https true; cd /var/www && bundle install --path /var/bundle --jobs 4" -s /bin/bash -l web
|
|
|
|
|
|
|
|
WORKDIR /var/www
|
|
|
|
USER web
|
|
|
|
|
|
|
|
RUN bundle config github.https true; cd /var/www && bundle install --path /var/bundle --jobs 4
|
|
|
|
|
|
|
|
USER root
|
|
|
|
CMD ["/var/www/script/entry.sh"]
|