Skip to content

Commit

Permalink
Add dotenv-rails gem to load environment variables from .env into ENV…
Browse files Browse the repository at this point in the history
… in development.
  • Loading branch information
zakariaf committed Dec 26, 2021
1 parent f7b759d commit 3aaa696
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

# export RAILS_ENV=development

## Puma
# export PORT=3000
# export PIDFILE=tmp/pids/server.pid
## Workers and threads count
# export WEB_CONCURRENCY=2
# export RAILS_MAX_THREADS=5
# export RAILS_MIN_THREADS=5

## Postgres
# export POSTGRES_HOST=postgres
# export POSTGRES_PORT=5432
export POSTGRES_USER=baseapp
export POSTGRES_PASSWORD=123456
export POSTGRES_DB=baseapp

## Redis URL
# export REDIS_URL=redis://redis:6379/1
# export REDIS_CHANNEL_PREFIX=baseapp

## Action cable
# export ACTION_CABLE_URL=ws://localhost:28080
# export ACTION_CABLE_ALLOWED_REQUEST_ORIGINS=http:\/\/localhost*
# Examples:
# http:\/\/localhost*
# http:\/\/example.*,https:\/\/example.*

## Sidekiq web
# export SIDEKIQ_WEB_USERNAME=sidekiq-web-dashboard
# export SIDEKIQ_WEB_PASSWORD=sidekiq-web-123
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@

# Ignore SampleCov files
/coverage/*

# Ignore env files
.env*
!.env.example
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ group :development, :test do
gem 'rubocop-rails_config'
gem 'annotate'
gem 'pry'
gem 'dotenv-rails'
end

group :development do
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ GEM
reline (>= 0.2.7)
diff-lcs (1.5.0)
docile (1.4.0)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
railties (>= 3.2)
erubi (1.10.0)
factory_bot (6.2.0)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -287,6 +291,7 @@ DEPENDENCIES
capybara
database_cleaner-active_record
debug
dotenv-rails
factory_bot_rails
faker
has_scope
Expand Down

0 comments on commit 3aaa696

Please sign in to comment.