forked from portagenetwork/roadmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.production
54 lines (43 loc) · 1.91 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM ruby:3.1.4
# Setup bundle to install gems to volume
ENV BUNDLE_PATH=/bundle/ \
BUNDLE_BIN=/bundle/bin \
GEM_HOME=/bundle \
DEBIAN_FRONTEND="noninteractive"
ENV Path="${BUNDLE_BIN}:${PATH}"
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
curl -sL https://deb.nodesource.com/setup_16.x | bash && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
# Dependancies
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
default-mysql-client \
gettext \
nodejs \
yarn \
locales
ENV LANG=fr_CA.UTF-8 \
LANGUAGE=fr_CA:fr \
LC_ALL=fr_CA.UTF-8
RUN wget --quiet https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz && \
tar vxf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz && \
cp wkhtmltox/bin/wk* /usr/local/bin/ && \
rm -rf wkhtmltox
ARG INSTALL_PATH=/usr/src/app/
ENV INSTALL_PATH $INSTALL_PATH
WORKDIR $INSTALL_PATH
COPY Gemfile* $INSTALL_PATH
# Install Bundler with the specified version from Gemfile.lock
RUN gem install bundler -v "$(tail -1 Gemfile.lock | tr -d " ")"
# for 3.1.0 test, need both mysql and psql group installed
RUN bundle config --local build.sassc --disable-march-tune-native
RUN bundle config set --local without 'development pssql test thin aws ci'
RUN RAILS_ENV=production bundle install --jobs=3 --retry=3
COPY . $INSTALL_PATH
RUN NODE_ENV=production yarn install --prod --check-files
RUN bundle config set force_ruby_platform true
# /bundle/ruby/2.7.0/bin/rake error: Could not find nokogiri-1.13.6, mini_portile2-2.5.3 in locally installed gems (Bundler::GemNotFound)
RUN bundle update rake
RUN DATABASE_URL=nulldb://user:[email protected]/roadmap RAILS_ENV=production SECRET_KEY_BASE=change_me DEVISE_SECRET_KEY=pickasecuretoken bundle exec rake assets:precompile
EXPOSE 3000
CMD bundle exec puma -C config/puma.rb