Answer the question
In order to leave comments, you need to log in
How to solve User `postgres` was denied access on the database `.public`?
There is an error User `postgres` was denied access on the database `toncoin_bot.public`,
- Locally everything works fine
- Docker starts without problems
FROM node:15.13.0
RUN mkdir -p /project/node_modules && chown -R node:node /project
WORKDIR /project
COPY package*.json ./
COPY --chown=node:node prisma ./prisma
COPY config ./config
RUN npm install
RUN npx prisma generate
RUN npx prisma db push // и тут ошибок нет
COPY --chown=node:node ./temp ./temp
RUN ./temp/loadTarrifs.js // тут нет ошибок
COPY --chown=node:node . .
CMD [ "node", "index.js" ]
version: '3.8'
services:
bot:
build:
context: .
dockerfile: .dockerfile
extra_hosts:
- host.docker.internal:172.17.0.1
volumes:
- node_modules:/project/node_modules
- ./workers:/project/workers
- ./config/:/project/config
- ./prisma:/project/prisma
depositing:
image: node:15.13.0
working_dir: /project
command: node workers/depositing.js
volumes:
- node_modules:/project/node_modules
- ./workers:/project/workers
- ./config/:/project/config
- ./prisma:/project/prisma
...
Answer the question
In order to leave comments, you need to log in
I found what the problem is, the problem is in docker-compose, it does not use the default network. Wow, wasted a week.
You need to be more careful when reading the doc, maybe it will come in handy for someone
The user under which the application is trying to connect does not have rights to the database. Give it to him.
The error is not postgres. The postgres user is usually a superuser, he cannot lack any rights (except for the only right to login).
Can you connect via psql (or any other client) to the database with this data?
Are there any problems with the network? Docker have access to 172.17.0.1:5432?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question