Hi @rayandenfir-1568,
It's state is terminated - in short, it didn't start at all so it's a reason why you cannot connect there.
Try to add command after the image:
command: tail -f /dev/null
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I tried implementing Postgres with Odoo in Azure through docker compose, I faced this error when I tried to check Odoo's container logs :
Database connection failure: connection to server at "db" (127.0.0.1), port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections ?
Here's my docker-compose.yml
version: '3.2'
services:
db:
image: registryodoo.azurecr.io/samples/postgres:13
volumes:
- db:/var/lib/postgresql/data/pgdata
deploy:
restart_policy:
condition: always
expose:
- 5432
environment:
POSTGRES_PASSWORD: odoo
POSTGRES_DB: postgres
POSTGRES_USER: odoo
PGDATA: /var/lib/postgresql/data/pgdata
odoocontainer:
depends_on:
- db
image: registryodoo.azurecr.io/samples/odoo:latest
volumes:
- data:/var/lib/odoo
- extra-addons:/mnt/extra-addons
ports:
- 8069:8069
deploy:
restart_policy:
condition: always
environment:
HOST: db
USER: odoo
PASSWORD: odoo
volumes:
data:
driver: azure_file
driver_opts:
share_name: odoofileshare
storage_account_name: odooaccount1
db:
driver: azure_file
driver_opts:
share_name: odoofileshare
storage_account_name: odooaccount1
extra-addons:
driver: azure_file
driver_opts:
share_name: odoofileshare
storage_account_name: odooaccount1
After looking at some answers in related questions I tried with : expose : - 5432 , ports : - 5432 and not writing it in the docker compose, I still had the same issue.
Here's the container logs:
Hi @rayandenfir-1568,
It's state is terminated - in short, it didn't start at all so it's a reason why you cannot connect there.
Try to add command after the image:
command: tail -f /dev/null