Skip to content

Commit

Permalink
Merge pull request #100 from trln/dockerization
Browse files Browse the repository at this point in the history
Dockerization
  • Loading branch information
kazymovae authored Oct 27, 2023
2 parents a460e7d + baed2cb commit f07c82a
Show file tree
Hide file tree
Showing 31 changed files with 875 additions and 61 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dockerfile
dbinit/
46 changes: 25 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,24 @@

# Ignore bundler config.
/.bundle
/.vagrant
vendor/bundle

# created by JetBrains' editors/IDEs
*.iml
.idea/

.vagrant_rails_env
*.sublime-*

# Directories created by vagrant directly

/.vagrant

# directories created by vagrant provisioner

.ruby-version
solr-dir/
tlrn-config/
.vagrant_rails_env
.db-password

# Ignore the default SQLite database.
/db/*.sqlite3
Expand All @@ -23,31 +35,23 @@
/tmp/*
!/log/.keep
!/tmp/.keep
tmp/
passenger.*.log
passenger*.lock
passenger*.pid

# Ignore Byebug command history file.
.byebug_history

# Local customizations
#
# Files downloaded by Ansible provisioners
ansible/roles/*

# might be
trln-config/
# Where Solr is installed
solr-dir/
# Where public Solr configuration is downloaded
argon-solr-config



# Other fiels created by/used by app
config/local_env.yml
comfig/mappings
config/mappings/
.password
postgres-setup.sql
*.sublime-*
.idea/
tmp/
passenger.*.log
passenger*.lock
passenger*.pid

# files created/used by containers (docker-compose.yml, init.sh)
.env
solr-docker/config/
153 changes: 153 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Relaxed.Ruby.Style

## Version 2.5

Style/Alias:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylealias

Style/AsciiComments:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleasciicomments

Style/BeginBlock:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylebeginblock

Style/BlockDelimiters:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleblockdelimiters

Style/CommentAnnotation:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylecommentannotation

Style/Documentation:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styledocumentation

Layout/DotPosition:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#layoutdotposition

Style/DoubleNegation:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styledoublenegation

Style/EndBlock:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleendblock

Style/FormatString:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleformatstring

Style/IfUnlessModifier:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleifunlessmodifier

Style/Lambda:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylelambda

Style/ModuleFunction:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylemodulefunction

Style/MultilineBlockChain:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylemultilineblockchain

Style/NegatedIf:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylenegatedif

Style/NegatedWhile:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile

Style/NumericPredicate:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylenumericpredicate

Style/ParallelAssignment:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleparallelassignment

Style/PercentLiteralDelimiters:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylepercentliteraldelimiters

Style/PerlBackrefs:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleperlbackrefs

Style/Semicolon:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylesemicolon

Style/SignalException:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylesignalexception

Style/SingleLineBlockParams:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylesinglelineblockparams

Style/SingleLineMethods:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylesinglelinemethods

Layout/SpaceBeforeBlockBraces:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#layoutspacebeforeblockbraces

Layout/SpaceInsideParens:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#layoutspaceinsideparens

Style/SpecialGlobalVars:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylespecialglobalvars

Style/StringLiterals:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylestringliterals

Style/TrailingCommaInArguments:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarguments

Style/TrailingCommaInArrayLiteral:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarrayliteral

Style/TrailingCommaInHashLiteral:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainhashliteral

Style/SymbolArray:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylesymbolarray

Style/WhileUntilModifier:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier

Style/WordArray:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylewordarray

Lint/AmbiguousRegexpLiteral:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#lintambiguousregexpliteral

Lint/AssignmentInCondition:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition

Layout/LineLength:
Enabled: false

Metrics:
Enabled: false
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ARG RUBY_VERSION=2.7-alpine
FROM ruby:${RUBY_VERSION} AS base

# note here that if you don't use an alpine flavor this
# package update will not work!

RUN apk update && apk upgrade && apk add --no-cache build-base sqlite-dev libpq-dev libxml2-dev libxslt-dev yajl git nodejs bash sqlite


COPY ./ /app/

WORKDIR /app

FROM base AS builder

RUN bundle config set path /gems && bundle install -j $(nproc)

FROM base

WORKDIR /app

COPY --from=builder /gems /gems

RUN bundle config set path /gems

COPY entrypoint /usr/local/bin/entrypoint
ENTRYPOINT ["/usr/local/bin/entrypoint"]
EXPOSE 3000
CMD ["server"]

4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ gem 'active_record_upsert', platform: :mri

gem 'argot', github: 'trln/argot-ruby', tag: 'v1.0.7'

gem 'solrtasks', github: 'trln/solrtasks'

# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
Expand Down Expand Up @@ -131,3 +129,5 @@ end

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

gem 'tzinfo-data'
15 changes: 3 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ GIT
traject (~> 2.0)
yajl-ruby (~> 1.2, >= 1.2.1)

GIT
remote: https://github.com/trln/solrtasks.git
revision: c463013d783bad2f9e61a9444914e8587329c9e2
specs:
solrtasks (0.2.7)
cocaine (~> 0.5.8)
nokogiri (>= 1.10)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -94,9 +86,6 @@ GEM
sassc-rails (>= 2.0.0)
builder (3.2.4)
byebug (11.1.3)
climate_control (0.2.0)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
coderay (1.1.3)
concurrent-ruby (1.1.9)
connection_pool (2.2.5)
Expand Down Expand Up @@ -270,6 +259,8 @@ GEM
turbolinks-source (5.2.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2022.1)
tzinfo (>= 1.0.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
Expand Down Expand Up @@ -316,12 +307,12 @@ DEPENDENCIES
sassc (~> 2.0.0)
sidekiq (~> 5.0)
simple_token_authentication (~> 1.0)
solrtasks!
spring
spring-watcher-listen (~> 2.0.0)
sqlite3
timecop (~> 0.9.1)
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
web-console
yajl-ruby (>= 1.3.1)
Expand Down
Loading

0 comments on commit f07c82a

Please sign in to comment.