Skip to content

Commit

Permalink
fix the dockerfile to auto precompile on building
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Dec 1, 2023
1 parent 31005da commit 27ba61d
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 77 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ ENV RAILS_LOG_TO_STDOUT="1" \
BUNDLE_PATH=/usr/local/bundle \
BUNDLE_WITHOUT="${BUNDLE_WITHOUT}"

# fix for ruby v2.7.8 only
RUN gem install uri --no-document
RUN gem update --system --no-document && \
gem install -N bundler

COPY Gemfile* .
RUN bundle install

RUN echo "--modules-folder /node_modules" > .yarnrc

COPY package.json *yarn* ./
RUN yarn install

Expand All @@ -44,6 +44,7 @@ COPY . .
# Precompile bootsnap code for faster boot times
RUN bundle exec bootsnap precompile --gemfile app/ lib/

RUN SECRET_KEY_BASE_DUMMY="1" ./bin/rails assets:precompile

ENV BINDING="0.0.0.0"
EXPOSE 3000
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '7.0.3'
gem 'rails', '7.1.0'

gem 'jsbundling-rails'

Expand Down
160 changes: 90 additions & 70 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,70 +17,78 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.3)
actionpack (= 7.0.3)
activesupport (= 7.0.3)
actioncable (7.1.0)
actionpack (= 7.1.0)
activesupport (= 7.1.0)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.3)
actionpack (= 7.0.3)
activejob (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
zeitwerk (~> 2.6)
actionmailbox (7.1.0)
actionpack (= 7.1.0)
activejob (= 7.1.0)
activerecord (= 7.1.0)
activestorage (= 7.1.0)
activesupport (= 7.1.0)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.3)
actionpack (= 7.0.3)
actionview (= 7.0.3)
activejob (= 7.0.3)
activesupport (= 7.0.3)
actionmailer (7.1.0)
actionpack (= 7.1.0)
actionview (= 7.1.0)
activejob (= 7.1.0)
activesupport (= 7.1.0)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.3)
actionview (= 7.0.3)
activesupport (= 7.0.3)
rack (~> 2.0, >= 2.2.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.0)
actionview (= 7.1.0)
activesupport (= 7.1.0)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.3)
actionpack (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.0)
actionpack (= 7.1.0)
activerecord (= 7.1.0)
activestorage (= 7.1.0)
activesupport (= 7.1.0)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.3)
activesupport (= 7.0.3)
actionview (7.1.0)
activesupport (= 7.1.0)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.3)
activesupport (= 7.0.3)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.0)
activesupport (= 7.1.0)
globalid (>= 0.3.6)
activemodel (7.0.3)
activesupport (= 7.0.3)
activerecord (7.0.3)
activemodel (= 7.0.3)
activesupport (= 7.0.3)
activestorage (7.0.3)
actionpack (= 7.0.3)
activejob (= 7.0.3)
activerecord (= 7.0.3)
activesupport (= 7.0.3)
activemodel (7.1.0)
activesupport (= 7.1.0)
activerecord (7.1.0)
activemodel (= 7.1.0)
activesupport (= 7.1.0)
timeout (>= 0.4.0)
activestorage (7.1.0)
actionpack (= 7.1.0)
activejob (= 7.1.0)
activerecord (= 7.1.0)
activesupport (= 7.1.0)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.3)
activesupport (7.1.0)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
Expand All @@ -99,6 +107,7 @@ GEM
erubi (~> 1.4)
parser (>= 2.4)
smart_properties
bigdecimal (3.1.4)
bindata (2.4.15)
bindex (0.8.1)
bootsnap (1.17.0)
Expand Down Expand Up @@ -138,6 +147,7 @@ GEM
railties (> 3.1)
coderay (1.1.3)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
crass (1.0.6)
css_parser (1.16.0)
addressable
Expand All @@ -152,11 +162,13 @@ GEM
diff-lcs (1.5.0)
docile (1.4.0)
domain_name (0.6.20231109)
drb (2.2.0)
ruby2_keywords
ed25519 (1.3.0)
erubi (1.12.0)
erubis (2.7.0)
eventmachine (1.2.7)
excon (0.104.0)
excon (0.105.0)
execjs (2.9.1)
faraday (2.0.1)
faraday-net_http (~> 2.0)
Expand Down Expand Up @@ -229,7 +241,7 @@ GEM
railties (>= 3.2.16)
jsbundling-rails (1.2.1)
railties (>= 6.0.0)
json (2.6.3)
json (2.7.0)
json-jwt (1.16.3)
activesupport (>= 4.2)
aes_key_wrap
Expand Down Expand Up @@ -284,13 +296,14 @@ GEM
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.3.0)
mutex_m (0.2.0)
mysql2 (0.5.5)
net-ftp (0.2.0)
net-protocol
time
net-http (0.3.2)
uri
net-imap (0.4.6)
net-imap (0.4.7)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -305,7 +318,7 @@ GEM
netrc (0.11.0)
newrelic_rpm (9.6.0)
base64
nio4r (2.6.1)
nio4r (2.7.0)
nokogiri (1.15.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.5-x86_64-linux)
Expand Down Expand Up @@ -364,22 +377,27 @@ GEM
rack (>= 1.2.0)
rack-protection (3.1.0)
rack (~> 2.2, >= 2.2.4)
rack-session (1.0.1)
rack (< 3)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.3)
actioncable (= 7.0.3)
actionmailbox (= 7.0.3)
actionmailer (= 7.0.3)
actionpack (= 7.0.3)
actiontext (= 7.0.3)
actionview (= 7.0.3)
activejob (= 7.0.3)
activemodel (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
rackup (1.0.0)
rack (< 3)
webrick
rails (7.1.0)
actioncable (= 7.1.0)
actionmailbox (= 7.1.0)
actionmailer (= 7.1.0)
actionpack (= 7.1.0)
actiontext (= 7.1.0)
actionview (= 7.1.0)
activejob (= 7.1.0)
activemodel (= 7.1.0)
activerecord (= 7.1.0)
activestorage (= 7.1.0)
activesupport (= 7.1.0)
bundler (>= 1.15.0)
railties (= 7.0.3)
railties (= 7.1.0)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
Expand All @@ -394,13 +412,14 @@ GEM
actionview (> 3.1)
activesupport (> 3.1)
railties (> 3.1)
railties (7.0.3)
actionpack (= 7.0.3)
activesupport (= 7.0.3)
method_source
railties (7.1.0)
actionpack (= 7.1.0)
activesupport (= 7.1.0)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.1.0)
rb-fsevent (0.11.2)
Expand All @@ -411,7 +430,7 @@ GEM
json
redcarpet (3.6.0)
regexp_parser (2.8.2)
reline (0.4.0)
reline (0.4.1)
io-console (~> 0.5)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
Expand Down Expand Up @@ -536,6 +555,7 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webrick (1.8.1)
websocket (1.2.10)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
Expand Down Expand Up @@ -604,7 +624,7 @@ DEPENDENCIES
psych (< 4)
puma (~> 5.0)
rack-mini-profiler
rails (= 7.0.3)
rails (= 7.1.0)
rails-i18n (~> 7.0.0)
rails_autolink
rdoc
Expand Down
6 changes: 4 additions & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')

# Include the BioPortal-specific configuration options
require Rails.root.join('config', "bioportal_config_#{Rails.env}.rb")

if File.exist?(Rails.root.join('config', "bioportal_config_#{Rails.env}.rb"))
require Rails.root.join('config', "bioportal_config_#{Rails.env}.rb")
end

# Use a different cache store in production.
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211", { namespace: 'bioportal_web_ui', expires_in: 1.day }

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
x-app: &default-app
image: agroportal/ontoportal_web_ui:test
image: agroportal/ontoportal_web_ui:development
env_file:
- ".env"
tty: true
Expand Down

0 comments on commit 27ba61d

Please sign in to comment.