diff --git a/README.md b/README.md index 9c6ca0623..b2714e667 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,8 @@ Every time you pull new changes down, kill docker (if it's running) and re-run: HostedGPT requires these services to be running: -- Postgres ([installation instructions](https://www.postgresql.org/download/)) +- Postgres (`brew install postgresql@16` or other [install instructions](https://www.postgresql.org/download/)) + - By default postgres will create a default user and following the instructions below to run the app should just work without any additional config, but if you want to set a specific username and password for your database then set the environment variable `DATABASE_URL=postgres://username:password@localhost/hostedgpt_development` (replacing `username`, `password`, and `hostedgpt_development` (database name) as appropriate - rbenv ([installation instructions](https://github.com/rbenv/rbenv)) - ImageMagick (`brew install imagemagick` should work on Mac ) diff --git a/config/database.yml b/config/database.yml index 6fa635417..f30a6c41c 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,24 +1,18 @@ default: &default adapter: postgresql encoding: unicode - host: localhost pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> port: <%= ENV['HOSTEDGPT_DATABASE_PORT'] || 5432 %> <% if RUBY_PLATFORM =~ /darwin/ %> gssencmode: disable <% end %> + url: <%= ENV['DATABASE_URL'] %> development: <<: *default - database: <%= ENV['HOSTEDGPT_DEV_DB'] || "hostedgpt_development" %> test: <<: *default - database: <%= ENV['HOSTEDGPT_TEST_DB'] || "hostedgpt_test" %> production: <<: *default - database: hostedgpt_production - username: hostedgpt - password: <%= ENV["HOSTEDGPT_DATABASE_PASSWORD"] %> - \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index a6d24ab0b..0f1dd41cb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,7 @@ services: target: development environment: # Be sure to add environment variables to config/options.yml - - DATABASE_URL=postgres://app:secret@postgres/app_development + - DATABASE_URL - DEV_HOST=${DEV_HOST:-localhost} # Set if you want to use a different hostname - OVERMIND_COLORS=2,3,5 - VOICE_FEATURE