Skip to content

Database connection during db:seed on host system #7

Description

@Fedcomp

I'm trying to bootstrap thredded with thredded_create_app.
After i noticed how many actions it's trying to do on my host system (updating all gems including rails, which i should do only myself), i decided to dockerize thredded_create_app. After some tries and errors i did it, but stuck at one of the steps.

bundle exec rails db:create db:migrate db:seed --quiet
could not connect to server: Connection refused
        Is the server running on host "localhost" (::1) and accepting
        TCP/IP connections on port 5432?
could not connect to server: Connection refused
        Is the server running on host "localhost" (127.0.0.1) and accepting
        TCP/IP connections on port 5432?
Couldn't create database for {"adapter"=>"postgresql", "min_messages"=>"WARNING", "pool"=>23, "host"=>"localhost", "port"=>5432, "username"=>"igromonik_dev", "password"=>"igromonik", "encoding"=>"utf8", "database"=>"igromonik_dev"}
rails aborted!
PG::ConnectionBad: could not connect to server: Connection refused
        Is the server running on host "localhost" (::1) and accepting
        TCP/IP connections on port 5432?
could not connect to server: Connection refused
        Is the server running on host "localhost" (127.0.0.1) and accepting
        TCP/IP connections on port 5432?

When thredded_create_app run migrations, it does it on host system. So, before you can use docker for development, somehow you need to install postgresql on your host system.
With all this i come to conclusion - with default options installer is completely unusable. I have to use sqlite option, and then edit it back to postgresql after everything is generated, but that defeats the purpose of all-in-one installer.

What is even more funny, i can't run it with docker-compose because it expects to find database on localhost, while docker-compose gives special hostname to each container.

So, the question is - is it expected behavior of installer? it's completely unusable with default options?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions