diff --git a/.ruby-version b/.ruby-version index 57cf282..49cdd66 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.5 +2.7.6 diff --git a/Dockerfile b/Dockerfile index 544dee2..6ea5eac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM ruby:2.6 +FROM ruby:2.7.6-alpine3.15 -RUN apt-get update -qq \ - && apt-get install -y build-essential libpq-dev nodejs \ - && mkdir /app +RUN apk add --update alpine-sdk && \ + apk add bash build-base git libxml2-dev libxslt-dev nodejs postgresql-dev readline-dev tzdata zlib-dev && \ + mkdir /app WORKDIR /app diff --git a/Gemfile b/Gemfile index c1d1b46..6b9cda0 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,11 @@ # frozen_string_literal: true -ruby '2.6.5' +ruby '2.7.6' git_source(:github) { |repo| "https://github.com/#{repo}.git" } source 'https://rubygems.org' do + gem 'bundle', '~> 2.3', '>= 2.3.18' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2', '>= 5.2.8.1' # Use Postgres as the database for Active Record diff --git a/Gemfile.lock b/Gemfile.lock index 9002e3f..837f074 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,6 @@ +GEM + specs: + GEM remote: https://rubygems.org/ specs: @@ -45,8 +48,8 @@ GEM arel (9.0.0) ast (2.4.0) bcrypt (3.1.12) - bootsnap (1.3.2) - msgpack (~> 1.0) + bootsnap (1.12.0) + msgpack (~> 1.2) builder (3.2.4) byebug (10.0.2) concurrent-ruby (1.1.10) @@ -101,7 +104,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.16.2) - msgpack (1.2.6) + msgpack (1.5.3) nio4r (2.5.8) nokogiri (1.13.7) mini_portile2 (~> 2.8.0) @@ -228,7 +231,7 @@ DEPENDENCIES jsonapi-resources (~> 0.10, >= 0.10.7)! listen (>= 3.0.5, < 3.2)! pg! - puma (~> 4.3)! + puma (~> 4.3, >= 4.3.9)! rails (~> 5.2, >= 5.2.8.1)! rerun! rspec-graphql_matchers! @@ -242,7 +245,7 @@ DEPENDENCIES yard! RUBY VERSION - ruby 2.6.5p114 + ruby 2.7.6p219 BUNDLED WITH - 1.17.3 + 2.3.18 diff --git a/config/database.yml b/config/database.yml index b7b22a5..70d8663 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,3 +1,4 @@ +--- # PostgreSQL. Versions 8.2 and up are supported. # # Install the pg driver: @@ -26,8 +27,10 @@ development: # Do not set this db to the same as development or production. test: <<: *default - database: freqfinder_test - + host: <%= ENV['PGHOST'] %> + user: <%= ENV['PGUSER'] %> + password: <%= ENV['PGPASSWORD'] %> + database: <%= ENV['PGDB'] %> production: <<: *default database: freqfinder_production diff --git a/docker-compose.test.yml b/docker-compose.test.yml index a3658af..c74b071 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -2,7 +2,12 @@ version: '3.4' services: db_test: - image: postgres + image: postgres:14.4-alpine + restart: always + environment: + POSTGRES_DB: db_test + POSTGRES_PASSWORD: password + POSTGRES_USER: postgres web: build: . command: bundle exec rspec @@ -14,7 +19,9 @@ services: CI: 'true' RAILS_ENV: test RACK_ENV: test + PGDB: db_test PGHOST: db_test + PGPASSWORD: password PGUSER: postgres ports: - "3000:3000"