Skip to content

Commit

Permalink
Feature: update docker compose to have a production service (#666)
Browse files Browse the repository at this point in the history
* update Dockerfile to precompile assets and create config files

* disable graphql intializer as not used and raise issues with docker

* docker ignore local credentials files so that will be created when run

* update docker compose file to have two services for dev and production
  • Loading branch information
syphax-bouazzouni committed Jun 9, 2024
1 parent 107b7b4 commit b050202
Show file tree
Hide file tree
Showing 11 changed files with 214 additions and 141 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ docker-compose.override.yml
yarn-error.log
yarn-debug.log*
.yarn-integrity

config/credentials/*
config/credentials.yml.enc
3 changes: 2 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ name: Docker branch Images build
on:
push:
branches:
- master
- development
- stage
- test
release:
types: [ published ]
types: [published]
jobs:
push_to_registry:
name: Push Docker branch image to Docker Hub
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ RUN yarn install && yarn build



RUN cp config/bioportal_config_env.rb.sample config/bioportal_config_production.rb
RUN cp config/bioportal_config_env.rb.sample config/bioportal_config_development.rb
RUN cp config/database.yml.sample config/database.yml

# 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
RUN SECRET_KEY_BASE_DUMMY="1" ./bin/rails assets:precompile

ENV BINDING="0.0.0.0"
EXPOSE 3000
Expand Down
52 changes: 24 additions & 28 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
source 'https://rubygems.org'

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

gem 'jsbundling-rails'
gem 'chart-js-rails'
gem 'sassc-rails' #sass-rails replacent
gem 'terser' #ugilifer replacent
gem 'jsbundling-rails'
gem 'sassc-rails' # sass-rails replacent
gem 'terser' # ugilifer replacent

# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
Expand All @@ -16,12 +16,9 @@ gem 'bootstrap', '~> 4.2.0'
gem 'jquery-rails'
gem 'jquery-ui-rails'



# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sprockets-rails'


# Use the Puma web server [https://github.com/puma/puma]
gem 'puma', '~> 5.0'

Expand All @@ -35,10 +32,10 @@ gem 'turbo-rails'
gem 'stimulus-rails'

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
#gem "jbuilder"
# gem "jbuilder"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[ mingw mswin x64_mingw jruby ]
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
Expand All @@ -49,41 +46,43 @@ gem 'bootsnap', require: false

gem 'cube-ruby', require: 'cube'
gem 'dalli'
gem 'ffi', '~> 1.16.3'
gem 'flag-icons-rails', '~> 3.4'
gem 'flamegraph'
gem 'graphql-client'
gem 'haml', '~> 5.1'
gem 'i18n'
gem 'rails-i18n', '~> 7.0.0'
gem 'iconv'
gem 'inline_svg'
gem 'iso-639', '~> 0.3.6'
gem 'lookbook', '~> 1.5.5'
gem 'multi_json'
gem 'mysql2'
gem 'oj'
gem 'ontologies_api_client', git: 'https://github.com/ontoportal-lirmm/ontologies_api_ruby_client.git',
branch: 'development'
gem 'open_uri_redirections'
gem 'pry'
gem 'psych', '< 4'
gem 'rack-mini-profiler'
gem 'rails_autolink'
gem 'rails-i18n', '~> 7.0.0'
gem 'rdoc'
gem 'recaptcha', '~> 5.9.0'
gem 'rest-client'
gem 'stackprof', require: false
gem 'thin'
gem 'view_component', '~> 2.72'
gem 'turnout'
gem 'view_component', '~> 2.72'
gem 'will_paginate', '~> 3.0'
gem 'inline_svg'
gem "lookbook", '~> 1.5.5'
gem 'ontologies_api_client', git: 'https://github.com/ontoportal-lirmm/ontologies_api_ruby_client.git', branch: 'development'
gem "flag-icons-rails", "~> 3.4"
gem "iso-639", "~> 0.3.6"

# Multi-Provider Authentication
gem 'omniauth'
gem "omniauth-rails_csrf_protection"
gem 'omniauth-github'
gem 'omniauth-google-oauth2'
gem 'omniauth-orcid'
gem 'omniauth-keycloak'
gem 'omniauth-orcid'
gem 'omniauth-rails_csrf_protection'

group :staging, :production, :appliance do
# application monitoring
Expand All @@ -110,16 +109,16 @@ group :development do
gem 'rubocop', require: false
# gem 'i18n-debug'
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem 'debug', platforms: %i[ mri mingw x64_mingw ]
gem 'debug', platforms: %i[mri mingw x64_mingw]

# Use console on exceptions pages [https://github.com/rails/web-console]
gem 'web-console'
gem 'i18n-tasks'
gem 'i18n-tasks-csv', '~> 1.1'
gem 'web-console'

gem 'deepl-rb'
gem 'letter_opener_web', '~> 2.0'
gem 'haml-rails'
gem 'letter_opener_web', '~> 2.0'
end

group :test, :development do
Expand All @@ -132,14 +131,11 @@ group :test do
gem 'selenium-webdriver'
gem 'simplecov', require: false
gem 'simplecov-cobertura' # for codecov.io
#gem 'webdrivers'
# gem 'webdrivers'
gem 'webmock'
end

gem 'net-ftp', '~> 0.2.0', require: false
gem 'net-http', '~> 0.3.2'

gem "net-ftp", "~> 0.2.0", require: false
gem "net-http", "~> 0.3.2"



gem "bugsnag", "~> 6.26"
gem 'bugsnag', '~> 6.26'
Loading

0 comments on commit b050202

Please sign in to comment.