Skip to content

Commit

Permalink
Add docker persistent database storage
Browse files Browse the repository at this point in the history
  • Loading branch information
Grigore-George-Mihai committed Oct 26, 2024
1 parent 2739868 commit fe15259
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-10-23 16:09:59 UTC using RuboCop version 1.67.0.
# on 2024-10-26 10:38:12 UTC using RuboCop version 1.67.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ GEM
execjs (2.10.0)
factory_bot (6.5.0)
activesupport (>= 5.0.0)
factory_bot_rails (6.4.3)
factory_bot (~> 6.4)
factory_bot_rails (6.4.4)
factory_bot (~> 6.5)
railties (>= 5.0.0)
faker (3.5.1)
i18n (>= 1.8.11, < 2)
Expand Down Expand Up @@ -210,7 +210,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.7.3)
json (2.7.4)
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
Expand All @@ -225,7 +225,7 @@ GEM
kaminari-core (1.2.2)
language_server-protocol (3.17.0.3)
logger (1.6.1)
loofah (2.22.0)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand Down Expand Up @@ -265,7 +265,7 @@ GEM
parser (3.3.5.0)
ast (~> 2.4.1)
racc
pg (1.5.8)
pg (1.5.9)
pghero (3.6.1)
activerecord (>= 6.1)
popper_js (2.11.8)
Expand Down Expand Up @@ -381,7 +381,7 @@ GEM
rubocop-performance (1.22.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.26.2)
rubocop-rails (2.27.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
Expand All @@ -393,7 +393,7 @@ GEM
rubocop-performance (>= 1.22.1, < 2.0)
rubocop-rails (>= 2.26.2, < 3.0)
rubocop-rspec (>= 3.1.0, < 4.0)
rubocop-rspec (3.1.0)
rubocop-rspec (3.2.0)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
Expand Down
2 changes: 1 addition & 1 deletion config/scout_apm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ common: &defaults
monitor: true
log_level: debug
key: <%= ENV.fetch("SCOUT_KEY", nil) %>
name: <%= ENV.fetch("SCOUT_NAME", nil) %>
name: <%= ENV.fetch("SCOUT_NAME", "DefaultTemplate") %>

production:
<<: *defaults
Expand Down
9 changes: 7 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
- POSTGRES_HOST=db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- DATABASE_URL=postgres://postgres:postgres@db:5432/myapp_development
- DATABASE_URL=postgres://postgres:postgres@db:5432/default_template_development
- REDIS_URL=redis://redis:6379/0
volumes:
- .:/rails
Expand Down Expand Up @@ -50,11 +50,16 @@ services:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: myapp_development
POSTGRES_DB: default_template_development
ports:
- "5433:5432"
volumes:
- default_template_pgdata:/var/lib/postgresql/data

redis:
image: redis:6.2
ports:
- "6380:6379"

volumes:
default_template_pgdata:
2 changes: 1 addition & 1 deletion spec/models/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "rails_helper"

RSpec.describe User, type: :model do
subject(:user) { create(:user) }
let(:user) { create(:user) }

describe "validations" do
%i[first_name last_name email].each do |attribute|
Expand Down

0 comments on commit fe15259

Please sign in to comment.