GithubHelp home page GithubHelp logo

Comments (7)

koistya avatar koistya commented on May 1, 2024

Take a look here: https://github.com/kriasoft/nodejs-api-starter/blob/master/config/postgres-initdb.sh#L8

from relay-starter-kit.

kraftpixel avatar kraftpixel commented on May 1, 2024

There was a missing database error initially too.
I think it was due to missing entries in the hosts file.

After adding those to my hosts file manually I did the following to try and recreate the database and it worked
docker-compose down
docker-compose up

Does docker add the entries to hosts file automatically?

Errors I noticed

api_1    | Node.js API server is listening on http://api:8080/
api_1    |   Error: getaddrinfo ENOTFOUND db db:5432
api_1    | Starting 'run'...
api_1    | Starting 'db-migrate'...
db_1     | FATAL:  database "dev" does not exist
db_1     | FATAL:  database "dev" does not exist
db_1     | FATAL:  database "dev" does not exist
api_1    | error: database "dev" does not exist
api_1    |     at Connection.parseE (/usr/src/app/node_modules/pg/lib/connection.js:567:11)
api_1    |     at Connection.parseMessage (/usr/src/app/node_modules/pg/lib/connection.js:391:17)
api_1    |     at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:129:22)
api_1    |     at emitOne (events.js:115:13)
api_1    |     at Socket.emit (events.js:210:7)
api_1    |     at addChunk (_stream_readable.js:252:12)
api_1    |     at readableAddChunk (_stream_readable.js:239:11)
api_1    |     at Socket.Readable.push (_stream_readable.js:197:10)
api_1    |     at TCP.onread (net.js:588:20)

from relay-starter-kit.

kraftpixel avatar kraftpixel commented on May 1, 2024

I tried installing it on a new system today and got this error.
/docker-entrypoint-initdb.d/initdb.sh: line 2: $'\r': command not found

from relay-starter-kit.

koistya avatar koistya commented on May 1, 2024

Just to be clear, are we talking about running the app on a dev machine, or you're trying to deploy it? The docker-compose.yml in this project is intended to be used in a development environment.

from relay-starter-kit.

kraftpixel avatar kraftpixel commented on May 1, 2024

Yup, that was when trying to run it on a dev machine through docker.

from relay-starter-kit.

koistya avatar koistya commented on May 1, 2024

One thing to node is that /docker-entrypoint-initdb.d/initdb.sh is only executed once when "data" volume is created (run docker volume ls to see the list of volumes). If the "dev" database is missing, you can either create it manually or remove the "data" volume and try running "docker compose up" again.

from relay-starter-kit.

koistya avatar koistya commented on May 1, 2024

I just included CREATE EXTENSION "uuid-ossp"; into the migration file.

from relay-starter-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.