26 lines
609 B
Docker
26 lines
609 B
Docker
FROM ruby:2.7.8
|
|
|
|
RUN apt-get update -qq && \
|
|
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
|
|
apt-get install -y build-essential libpq-dev nodejs && \
|
|
useradd --user-group --create-home --shell /bin/false app
|
|
|
|
ENV HOME=/home/app
|
|
WORKDIR $HOME/wedding
|
|
USER app
|
|
|
|
ENV RAILS_ENV=production
|
|
|
|
# Install gems first
|
|
COPY --chown=app:app Gemfile Gemfile.lock ./
|
|
RUN bundle install --without development test
|
|
|
|
# Copy application code
|
|
COPY --chown=app:app . ./
|
|
|
|
# Precompile assets
|
|
RUN bundle exec rake assets:precompile
|
|
|
|
# Start server
|
|
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
|