-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (27 loc) · 1.07 KB
/
Copy pathDockerfile
File metadata and controls
34 lines (27 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM ruby:2.7.4
MAINTAINER Santiago Ramos "sramos@sitiodistinto.net"
# Set the base directory used in any further RUN, COPY, and ENTRYPOINT
# commands.
RUN apt-get update -qq && \
apt-get upgrade -qq && \
apt-get install -qq -y build-essential libpq-dev nodejs && \
rm -rf /var/lib/apt/lists/*
# Set base directory
RUN mkdir -p /railsapp
WORKDIR /railsapp
# Set the Rails environment to production
ENV RAILS_ENV production
ENV RAILS_SERVE_STATIC_FILES true
ENV RAILS_LOG_TO_STDOUT true
# Copy dependencies into the container
COPY Gemfile Gemfile.lock ./
RUN gem install bundler && bundle install --jobs 20 --retry 5 --without development test
# Copy the main application into the container
COPY . ./
RUN chmod +x /railsapp/bin/*
# Precompile the Rails assets (with fake connection data)
RUN bundle exec rake RAILS_ENV=production SECRET_KEY_BASE=blahblahblah assets:clobber
RUN bundle exec rake RAILS_ENV=production SECRET_KEY_BASE=blahblahblah assets:precompile
# Start the application with Puma
ENTRYPOINT ["/railsapp/bin/entrypoint"]
CMD bundle exec puma -C config/puma.rb