forked from e621ng/e621ng
[CI] Commit database.yml
Makes the test setup easier. Also eases prod deploys with the two separate db pool sizes.
This commit is contained in:
parent
3fc87634eb
commit
09be4cded9
17
.env.sample
17
.env.sample
@ -26,23 +26,6 @@
|
||||
# export UNICORN_USER=danbooru
|
||||
# export UNICORN_GROUP=danbooru
|
||||
|
||||
#
|
||||
# Database
|
||||
#
|
||||
|
||||
# DATABASE_URL takes precedence over config/database.yml if defined.
|
||||
|
||||
# Put these in .env.production or .env.development to define your dev/prod
|
||||
# databases. Do not define it in .env or .env.local! It will be taken as your
|
||||
# test database too, and rails will wipe it if you run the test suite.
|
||||
#
|
||||
# If you are connecting to PostgreSQL via socket, omit the hostname (e.g.
|
||||
# postgresql:///danbooru2)
|
||||
# export DATABASE_URL="postgresql://localhost/danbooru2"
|
||||
|
||||
# Put these in .env.test to define your test database.
|
||||
# export DATABASE_URL="postgresql://localhost/danbooru2_test"
|
||||
|
||||
#
|
||||
# Rails
|
||||
#
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,7 +1,7 @@
|
||||
.env
|
||||
.env.production
|
||||
.bundle
|
||||
.yardoc
|
||||
config/database.yml
|
||||
config/danbooru_local_config.rb
|
||||
config/deploy/*.rb
|
||||
config/application.yml
|
||||
|
@ -14,9 +14,6 @@ FileUtils.chdir APP_ROOT do
|
||||
# Add necessary setup steps to this file.
|
||||
|
||||
puts "\n== Copying sample files =="
|
||||
unless File.exist?('config/database.yml')
|
||||
FileUtils.cp 'docker/database.yml', 'config/database.yml'
|
||||
end
|
||||
unless File.exist?('config/danbooru_local_config.rb')
|
||||
FileUtils.cp 'docker/danbooru_local_config.rb', 'config/danbooru_local_config.rb'
|
||||
end
|
||||
|
25
config/database.yml
Executable file
25
config/database.yml
Executable file
@ -0,0 +1,25 @@
|
||||
default: &default
|
||||
adapter: postgresql
|
||||
timeout: 5000
|
||||
|
||||
development:
|
||||
<<: *default
|
||||
database: danbooru2
|
||||
username: danbooru
|
||||
host: postgres
|
||||
pool: 5
|
||||
|
||||
test:
|
||||
<<: *default
|
||||
database: danbooru2_test
|
||||
username: danbooru
|
||||
host: postgres
|
||||
pool: 5
|
||||
|
||||
production:
|
||||
<<: *default
|
||||
database: e621
|
||||
username: e621
|
||||
password: <%= ENV["DB_PASSWORD"] %>
|
||||
host: <%= ENV["DB_HOST"] %>
|
||||
pool: <%= Sidekiq.server? ? ENV["DB_WORKER_POOL_SIZE"] : ENV["DB_POOL_SIZE"] %>
|
@ -1,7 +1,6 @@
|
||||
version: "3"
|
||||
|
||||
x-environment: &common-env
|
||||
DATABASE_URL: postgresql://danbooru:@postgres
|
||||
DANBOORU_HOSTNAME: http://localhost:3000
|
||||
DANBOORU_REDIS_URL: redis://redis
|
||||
DANBOORU_ELASTICSEARCH_HOST: elastic
|
||||
|
@ -1,25 +0,0 @@
|
||||
# SQLite version 3.x
|
||||
# gem install sqlite3-ruby (not necessary on OS X Leopard)
|
||||
development:
|
||||
adapter: postgresql
|
||||
database: danbooru2
|
||||
pool: 5
|
||||
timeout: 5000
|
||||
url: <%= ENV['DATABASE_URL'] %>
|
||||
|
||||
# Warning: The database defined as "test" will be erased and
|
||||
# re-generated from your development database when you run "rake".
|
||||
# Do not set this db to the same as development or production.
|
||||
test:
|
||||
adapter: postgresql
|
||||
database: danbooru2_test
|
||||
pool: 5
|
||||
timeout: 5000
|
||||
url: <%= ENV['DATABASE_URL'] %>
|
||||
|
||||
production:
|
||||
adapter: postgresql
|
||||
database: danbooru2
|
||||
pool: 5
|
||||
timeout: 5000
|
||||
url: <%= ENV['DATABASE_URL'] %>
|
Loading…
Reference in New Issue
Block a user