Skip to content

Commit

Permalink
Introduces a PG database
Browse files Browse the repository at this point in the history
  • Loading branch information
hennevogel committed Jun 29, 2022
1 parent ea908c2 commit 80fd761
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN zypper -n ar -f \
MozillaFirefox \
nodejs16 ruby3.1-devel \
libxml2-devel libxslt-devel \
postgresql14-devel \
ImageMagick

# Setup ruby in PATH & sudo
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ gem 'sprockets-rails'
gem 'puma'
# as templating engine
gem 'haml-rails', '~> 2.0'
# as database
gem 'pg'

# for appdata redirections (https -> http)
gem 'open_uri_redirections'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ GEM
parallel (1.22.1)
parser (3.1.2.0)
ast (~> 2.4.1)
pg (1.4.1)
pkg-config (1.4.7)
prime (0.1.2)
forwardable
Expand Down Expand Up @@ -358,6 +359,7 @@ DEPENDENCIES
multi_xml
nokogiri
open_uri_redirections
pg
puma
puma_worker_killer
rails (~> 7.0)
Expand Down
3 changes: 3 additions & 0 deletions app/models/application_record.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Pick the frameworks you want:
require "active_model/railtie"
# require "active_job/railtie"
# require "active_record/railtie"
require "active_record/railtie"
# require "active_storage/engine"
require "action_controller/railtie"
# require "action_mailer/railtie"
Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ version: "2.1"
services:
memcached:
image: registry.opensuse.org/opensuse/memcached:latest
database:
image: postgres:14-alpine
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_PASSWORD: mysecretpassword
software:
build:
dockerfile: Dockerfile
Expand All @@ -15,5 +20,7 @@ services:
- "3000:3000"
depends_on:
- memcached
- database
environment:
- MEMCACHED_HOST="memcached:11211"
- DATABASE_URL=postgres://postgres:mysecretpassword@database/postgres?pool=5
Binary file added vendor/cache/pg-1.4.1.gem
Binary file not shown.

0 comments on commit 80fd761

Please sign in to comment.