Skip to content

Commit

Permalink
apply corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Feb 12, 2024
1 parent f0d1a98 commit 915ada5
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 25 deletions.
3 changes: 0 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ DATABASE_USER=postgres
DATABASE_NAME=timeoverflow_development

#RAILS CONFIG
RAILS_SERVE_STATIC_FILES=true
RAILS_LOG_TO_STDOUT=true
RAILS_LOG_LEVEL=debug
QUEUE_ADAPTER=sidekiq
STORAGE_PROVIDER=amazon
FORCE_SSL=true

Expand Down
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@ COPY ./public/*.* /app/public/
COPY ./config.ru /app/config.ru
COPY ./Rakefile /app/Rakefile

# Compile assets with Webpacker or Sprockets
# Compile assets
#
# Notes:
# 1. Executing "assets:precompile" runs "webpacker:compile", too
# 2. For an app using encrypted credentials, Rails raises a `MissingKeyError`
# if the master key is missing. Because on CI there is no master key,
# we hide the credentials while compiling assets (by renaming them before and after)
# For an app using encrypted credentials, Rails raises a `MissingKeyError`
# if the master key is missing. Because on CI there is no master key,
# we hide the credentials while compiling assets (by renaming them before and after)
#
RUN mv config/credentials.yml.enc config/credentials.yml.enc.bak 2>/dev/null || true
RUN mv config/credentials config/credentials.bak 2>/dev/null || true
Expand Down
3 changes: 0 additions & 3 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ class Application < Rails::Application
# SKYLIGHT_AUTHENTICATION env var for this to work.
config.skylight.environments += ["staging"]

# ActiveJob configuration
config.active_job.queue_adapter = :sidekiq

# Use db/structure.sql with SQL as schema format
# This is needed to store in the schema SQL statements not covered by the ORM
config.active_record.schema_format = :sql
Expand Down
4 changes: 0 additions & 4 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ test:

staging:
<<: *defaults
# collation: 'es_ES.UTF-8'
# ctype: 'es_ES.UTF-8'
database: <%= ENV.fetch('DATABASE_NAME', 'timeoverflow_staging') %>

production:
<<: *defaults
# collation: 'es_ES.UTF-8'
# ctype: 'es_ES.UTF-8'
<%= "url: #{ENV['DATABASE_URL']}" if ENV['DATABASE_URL'].present? %>
<%= "database: #{ENV.fetch('DATABASE_NAME', 'timeoverflow_production')}" unless ENV['DATABASE_URL'].present? %>
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
# config.cache_store = :mem_cache_store

# Use a real queuing backend for Active Job (and separate queues per environment).
config.active_job.queue_adapter = ENV.fetch("QUEUE_ADAPTER", nil) if ENV["QUEUE_ADAPTER"].present?
config.active_job.queue_adapter = :sidekiq
# config.active_job.queue_name_prefix = "timeoverflow_production"

config.action_mailer.perform_caching = false
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ services:
environment:
- DATABASE_URL=postgres://postgres:timeoverflow@db/timeoverflow
- SECRET_KEY_BASE=d2a645fb46fbd3d4380fb22230ddea4062570eb00853ca5dfe97f8bb1cbff1ad6891c573a4b4b06beb2d0baf59afc9e00794314490a644fc5808ad6cbc3a6379
- QUEUE_ADAPTER=sidekiq
- FORCE_SSL=false
- RAILS_LOG_LEVEL=debug
- REDIS_URL=redis://redis:6379/0
Expand All @@ -27,7 +26,6 @@ services:
environment:
- DATABASE_URL=postgres://postgres:timeoverflow@db/timeoverflow
- SECRET_KEY_BASE=d2a645fb46fbd3d4380fb22230ddea4062570eb00853ca5dfe97f8bb1cbff1ad6891c573a4b4b06beb2d0baf59afc9e00794314490a644fc5808ad6cbc3a6379
- QUEUE_ADAPTER=sidekiq
- FORCE_SSL=false
- RAILS_LOG_LEVEL=debug
- REDIS_URL=redis://redis:6379/0
Expand Down
7 changes: 1 addition & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
# Run rails by default if sidekiq is specified
if [ -z "$RUN_RAILS" ] && [ -z "$RUN_SIDEKIQ" ]; then
RUN_RAILS=true
echo "⚠️ RUN_RAILS and RUN_SIDEKIQ are not set, defaulting to RUN_RAILS=true"
fi

if [ "$QUEUE_ADAPTER" != "sidekiq" ]; then
RUN_SIDEKIQ=false
echo "⚠️ Sidekiq is disabled because QUEUE_ADAPTER is not set to sidekiq"
echo "⚠️ RUN_RAILS and RUN_SIDEKIQ are not set, defaulting to RUN_RAILS=true, RUN_SIDEKIQ=false"
fi

# ensure booleans
Expand Down

0 comments on commit 915ada5

Please sign in to comment.