16
Dockerfile
16
Dockerfile
@ -1,23 +1,25 @@
|
|||||||
FROM ruby:2.7.8
|
FROM ruby:2.7.8
|
||||||
|
|
||||||
# Point to Debian archive repos instead of the dead ones
|
|
||||||
|
|
||||||
RUN apt-get update -qq && \
|
RUN apt-get update -qq && \
|
||||||
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
|
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
|
||||||
apt-get install -y build-essential libpq-dev nodejs && \
|
apt-get install -y build-essential libpq-dev nodejs && \
|
||||||
useradd --user-group --create-home --shell /bin/false app
|
useradd --user-group --create-home --shell /bin/false app
|
||||||
|
|
||||||
ENV HOME=/home/app
|
ENV HOME=/home/app
|
||||||
|
WORKDIR $HOME/wedding
|
||||||
USER app
|
USER app
|
||||||
|
|
||||||
ENV RAILS_ENV=production
|
ENV RAILS_ENV=production
|
||||||
|
|
||||||
COPY --chown=app:app Gemfile Gemfile.lock $HOME/wedding/
|
# Install gems first
|
||||||
WORKDIR $HOME/wedding
|
COPY --chown=app:app Gemfile Gemfile.lock ./
|
||||||
RUN bundle
|
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"]
|
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
|
||||||
|
|
||||||
COPY --chown=app:app . $HOME/wedding/
|
|
||||||
|
Reference in New Issue
Block a user