diff --git a/.dockerignore b/.dockerignore index 29b75eab..b58e3ee9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -13,6 +13,7 @@ tmp /db/**/*.sqlite3 /db/**/*.sqlite3-journal /db/production +/db/production-postgres public/assets public/b coverage/ diff --git a/.gitignore b/.gitignore index 20667ff4..7a58b323 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ vendor/bundle # Ignore production paths. /db/production +/db/production-postgres # Ignore all logfiles and tempfiles. /log/* diff --git a/Gemfile b/Gemfile index ab2fbb19..d99e1818 100644 --- a/Gemfile +++ b/Gemfile @@ -77,6 +77,7 @@ gem 'cancancan', '~> 2.0' group :production do # Use a postgres database in production. gem 'pg', '~> 0.18' + gem 'sequel' # For a better logging library in production gem "lograge" diff --git a/Gemfile.lock b/Gemfile.lock index e29d0f0b..861a2fe2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -292,6 +292,7 @@ GEM sprockets (> 3.0) sprockets-rails tilt + sequel (5.29.0) shoulda-matchers (3.1.3) activesupport (>= 4.0.0) simplecov (0.16.1) @@ -387,6 +388,7 @@ DEPENDENCIES rspec-rails (~> 3.7) rubocop sassc-rails + sequel shoulda-matchers (~> 3.1) spring spring-watcher-listen (~> 2.0.0) diff --git a/docker-compose.yml b/docker-compose.yml index 09077087..8fe09c3b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,19 +18,19 @@ services: volumes: - ./log:/usr/src/app/log # When using sqlite3 as the database - - ./db/production:/usr/src/app/db/production +# - ./db/production:/usr/src/app/db/production # When using postgresql as the database -# links: -# - db -# db: -# image: postgres:9.5 -# restart: on-failure -# ports: -# - 127.0.0.1:5432:5432 -# volumes: -# - ./db/production:/var/lib/postgresql/data -# environment: -# - PGHOST=postgres -# - PGDATABASE=postgres -# - PGUSER=postgres -# - PGPASSWORD=password + links: + - db + db: + image: postgres:9.5 + restart: on-failure + ports: + - 127.0.0.1:5432:5432 + volumes: + - ./db/production:/var/lib/postgresql/data + environment: + - PGHOST=postgres + - PGDATABASE=postgres + - PGUSER=postgres + - PGPASSWORD=password diff --git a/sample.env b/sample.env index 50cba33f..ca870e80 100644 --- a/sample.env +++ b/sample.env @@ -215,11 +215,11 @@ REPORT_ISSUE_URL=https://github.com/bigbluebutton/greenlight/issues/new # # For deployments based on the docker-compose script also included, the HOST should be set with the Docker container id. # -# DB_ADAPTER=postgresql -# DB_HOST=db -# DB_NAME=greenlight_production -# DB_USERNAME=postgres -# DB_PASSWORD=password +DB_ADAPTER=postgresql +DB_HOST=db +DB_NAME=greenlight_production +DB_USERNAME=postgres +DB_PASSWORD=password # Specify the default registration to be used by Greenlight until an administrator sets the # registration method