Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.2'

services:
postgres:
image: postgres:12
ports:
- 5432:5432
restart: on-failure
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pg_search_test
3 changes: 2 additions & 1 deletion spec/support/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@

begin
connection_options = { adapter: 'postgresql', database: 'pg_search_test', min_messages: 'warning' }
if ENV["CI"]
if ENV["CI"] || ENV["DOCKER"]
connection_options[:username] = 'postgres'
connection_options[:password] = 'postgres'
end
connection_options[:host] = 'localhost' if ENV["DOCKER"]
ActiveRecord::Base.establish_connection(connection_options)
connection = ActiveRecord::Base.connection
connection.execute("SELECT 1")
Expand Down