Replies: 3 comments
-
Hi, I think this is the issue:
By default, postgres is setup to listen on port 5432, so if you wish to change the external port to avoid conflicts it should be:
My suggestion in any case is not to expose the database port unless you want to access outside the containers in that compose. So these lines should be commented (or deleted):
The you just need to be sure that the environment variable (.env file) should be pointing this database container:
|
Beta Was this translation helpful? Give feedback.
-
thanks for your response. the ports rule was already commented in my docker file. I had two variables incorrect in my yml. The TM_DB_NAME_OLD that you pointed out was incorrect and the DB hostname was incorrect. After fixing these two I was able to connect to the psql server. Now restoring my database is causing issues with these changes which is a problem to be solved for some other day :-) Below the working version services: database_old: volumes: |
Beta Was this translation helpful? Give feedback.
-
Great! You got it! Enjoy. |
Beta Was this translation helpful? Give feedback.
-
I want to create two instances of teslamate, one for viewing only (which I will populate by restoring an older database) and another instance for getting live data from my car. I was successful in creating using two instances, but seems like the view only instance cannot connect to the postgres database therefore all the dashboard queries are failing. Does anyone have any suggestions?
From the log I see the below messages.
2023-09-24T05:47:23.807861630Z waiting for postgres at database:5432
2023-09-24T05:47:24.816184175Z waiting for postgres at database:5432
2023-09-24T05:47:25.823535559Z waiting for postgres at database:5432
2023-09-24T05:47:26.829929375Z waiting for postgres at database:5432
2023-09-24T05:47:27.837147913Z waiting for postgres at database:5432
2023-09-24T05:47:28.844702202Z waiting for postgres at database:5432
2023-09-24T05:47:29.852730782Z waiting for postgres at database:5432
2023-09-24T05:47:30.860477278Z waiting for postgres at database:5432
My docker definition for this service is like below.
database_old:
image: postgres:14
restart: always
environment:
- POSTGRES_USER=${TM_DB_USER}
- POSTGRES_PASSWORD=${TM_DB_PASS}
- POSTGRES_DB=${TM_DB_NAME_OLD}
Beta Was this translation helpful? Give feedback.
All reactions