-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.production
30 lines (23 loc) · 1.01 KB
/
Dockerfile.production
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
FROM ruby:2.7.6
ENV RAILS_ENV=production
# https://yarnpkg.com/lang/en/docs/install/#debian-stable
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get update -qq \
&& apt-get install -y nodejs yarn vim
ENV APP_ROOT /app
COPY . $APP_ROOT
WORKDIR $APP_ROOT
ENV BUNDLE_PATH /app/vendor/bundle
RUN gem install bundler -v 2.4.22
RUN bundle update --bundler
RUN bundle install --without development --without test
RUN bundle exec yarn install
RUN bundle exec yarn build
RUN bundle exec yarn deploy
# This is just needed for asset compilation -- it's okay that it is in the source
ENV SECRET_KEY_BASE=a22302b6b65eb0291b31f25a3457f9fc131fe73cf2c9926dd1de3679ad7732c33c4d3691b9710e1225d0ab77540954315575a4ceb8f843ed51c8189bc998dd4e
RUN bundle exec rails assets:precompile
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
EXPOSE 3000