Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems running local API docker #27

Open
hacheandres opened this issue Jun 13, 2022 · 1 comment
Open

Problems running local API docker #27

hacheandres opened this issue Jun 13, 2022 · 1 comment

Comments

@hacheandres
Copy link

Hi everyone, first of all I beg your pardon by my English.

I'm trying to run a local instance of the fxhash system, including the API, but I'm having some troubles and maybe you can help me to solve it and also to fix it on the repo.

I'm running:
docker-compose version 1.25.0, build unknown

Following the readme when I run:
docker-compose up -d
I got next error:

api_1       | > nodemon --watch "src/**/*.ts" --exec "ts-node --transpile-only" src/index.ts
api_1       | 
api_1       | sh: nodemon: not found
fxhash-api_api_1 exited with code 127

I solve it changing a line in docker-compose.yaml

services:
  api:
    command: sh -c "/wait && npm run start"

to:

services:
  api:
    command: sh -c "/wait && npm install && npm run start"

After this little fix, that BTW I'm not sure if it's the correct way to solve it, I run docker-compose up -d again and get the next error:

api_1       | > nodemon --watch "src/**/*.ts" --exec "ts-node --transpile-only" src/index.ts
api_1       | 
api_1       | [nodemon] 2.0.13
api_1       | [nodemon] to restart at any time, enter `rs`
api_1       | [nodemon] watching path(s): src/**/*.ts
api_1       | [nodemon] watching extensions: ts,json
api_1       | [nodemon] starting `ts-node --transpile-only src/index.ts`
api_1       | /app/node_modules/pg/lib/connection.js:71
api_1       |           return self.emit('error', new Error('The server does not support SSL connections'))
api_1       |                                     ^
api_1       | Error: The server does not support SSL connections
api_1       |     at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:71:37)
api_1       |     at Object.onceWrapper (node:events:642:26)
api_1       |     at Socket.emit (node:events:527:28)
api_1       |     at Socket.emit (node:domain:475:12)
api_1       |     at addChunk (node:internal/streams/readable:315:12)
api_1       |     at readableAddChunk (node:internal/streams/readable:289:9)
api_1       |     at Socket.Readable.push (node:internal/streams/readable:228:10)
api_1       |     at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
api_1       | [nodemon] app crashed - waiting for file changes before starting...

Now, nodemon run correctly but it crash with SSL error that I don't have a clue how to solve.

Could anyone help me? Thanks in advance!

@acharlop
Copy link

For the first issue perhaps you didn't have nodemon or yarn installed globally, since yarn install is run in the Dockerfile

For the second issue I solved it by making the following changes to src/index.ts. I'm not sure if it's the ideal solution or what the root cause is but it works.

from:

ssl: {
	rejectUnauthorized: false,
},

to:

ssl: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants