ensl.org/Dockerfile
Ari Timonen 4a8bd8ee7d Update ensl.org for docker version
Create docker version
- Remove rubyracer, use nodejs
- Add Makefile and fig.yml examples
- Update to v2 circle.yml sample
- Create Dockerfile
- Do not use nested folders in tmp for puma
2018-04-10 01:08:38 +00:00

38 lines
948 B
Docker

FROM ruby:2.2
ENV RAILS_ENV production
# 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
RUN apt-get -y install mysql-client libmysqlclient-dev memcached nodejs
# Separate Gemfile ADD so that `bundle install` can be cached more effectively
ADD Gemfile /var/www/
ADD Gemfile.lock /var/www/
RUN chown -R web:web /var/www &&\
mkdir -p /var/bundle &&\
chown -R web:web /var/bundle
RUN bundle config github.https true
RUN su -c "cd /var/www && bundle install --path /var/bundle" -s /bin/bash -l web
# Add application source
ADD . /var/www
RUN chown -R web:web /var/www
USER web
# Precompile assets
WORKDIR /var/www
COPY .env /var/www/
RUN bundle install --path /var/bundle
RUN bundle exec rake assets:precompile
# When using bash
USER root
CMD ["bundle", "exec", "puma", "-C /var/www/config/puma.rb"]