# Troubles with docker+postgre

**URL:** <https://forums.docker.com/t/troubles-with-docker-postgre/138095>\
**Category:** General\
**Tags:** docker, docker-compose\
**Created:** [October 15, 2023, 10:35am UTC](https://forums.docker.com/t/troubles-with-docker-postgre/138095 "2023-10-15T10:35:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![slaenov](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@slaenov](https://forums.docker.com/u/slaenov)\
**Post date:** [October 15, 2023, 10:35am UTC](https://forums.docker.com/t/troubles-with-docker-postgre/138095/1 "2023-10-15T10:35:39Z")

</div>

Hello everyone. There was such a problem in postgre and docker. The bottom line: there is a Python script on the server-telegram bot. It works with postgre. If you run it on the server, everything is fine. If in postgre, what is in docker-problems begin. I did port forwarding using dockerfile to the host-it works clumsily. The python script works via psycopg2 import-connects to the database, authorizes. But there are always some mistakes. The script is written (sort of) exactly. I went through dockerfile, docker-compose.yml, and still - nonsense. Task: to work smoothly, without errors. If someone understands, please tell me.

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [October 15, 2023, 10:46am UTC](https://forums.docker.com/t/troubles-with-docker-postgre/138095/2 "2023-10-15T10:46:14Z")

</div>

Your post is to ambiguous (at least for me) to get an idea of the root cause.

Please add a code example and share the exact error messages from the log. Make sure you format the shared code example and error messages according [How to format your forum posts](https://forums.docker.com/t/how-to-format-your-forum-posts/127295) - do not share them as screenshot. Thank you!
