Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Erro ao chamar endpoint

Bom dia,

Esse comando seria diferente no windows?

docker run --rm --name api -p 8000:3000 -v ~/forum-alura:/config -e GOOGLE_APPLICATION_CREDENTIALS=/config/autenticacao.json -e GOOGLE_CLOUD_PROJECT=denis-393921 forum-alura

Ao chamar o endpoint com o postman:

Error: The file at C:/Program Files/Git/config/autenticacao.json does not exist, or it is not a file. ENOENT: no such file or directory, lstat '/C:'
      at Object.realpathSync (fs.js:1461:7)
      at GoogleAuth._getApplicationCredentialsFromFilePath (/app/node_modules/@google-cloud/common/node_modules/google-auth-library/build/src/auth/googleauth.js:308:27)
      at GoogleAuth._tryGetApplicationCredentialsFromEnvironmentVariable (/app/node_modules/@google-cloud/common/node_modules/google-auth-library/build/src/auth/googleauth.js:249:25)
      at GoogleAuth.getApplicationDefaultAsync (/app/node_modules/@google-cloud/common/node_modules/google-auth-library/build/src/auth/googleauth.js:173:24)
      at GoogleAuth.getClient (/app/node_modules/@google-cloud/common/node_modules/google-auth-library/build/src/auth/googleauth.js:624:28)
      at GoogleAuth.authorizeRequest (/app/node_modules/@google-cloud/common/node_modules/google-auth-library/build/src/auth/googleauth.js:665:35)
      at authorizeRequest (/app/node_modules/@google-cloud/common/build/src/util.js:439:47)
      at prepareRequest (/app/node_modules/@google-cloud/common/build/src/util.js:444:25)
      at BigQuery.makeAuthenticatedRequest (/app/node_modules/@google-cloud/common/build/src/util.js:455:13)
      at BigQuery.request_ (/app/node_modules/@google-cloud/common/build/src/service.js:148:18)

Tentei algumas variações, mas não consegui.

1 resposta
solução!

docker run --rm --name api -p 8000:3000 -v 'caminho absoluto':/config -e GOOGLE_APPLICATION_CREDENTIALS=(remover / do começo)config/autenticacao.json -e GOOGLE_CLOUD_PROJECT=denis-393921 forum-alura

Deu certo!