connectivity issue via docker
Here is my docker file.
version: "3.9"
name: twenty
services:
server:
image: twentycrm/twenty:${TAG}
volumes:
- server-local-data:/app/${STORAGE_LOCAL_PATH:-.local-storage}
ports:
- "3000:3000"
- "5173:5173"
networks:
- twenty-network
environment:
PORT: 3000
PG_DATABASE_URL: postgres://twenty:twenty@${PG_DATABASE_HOST}/default
SERVER_URL: ${SERVER_URL}
FRONT_BASE_URL: ${FRONT_BASE_URL:-$SERVER_URL}
ENABLE_DB_MIGRATIONS: "true"
SIGN_IN_PREFILLED: ${SIGN_IN_PREFILLED}
STORAGE_TYPE: ${STORAGE_TYPE}
STORAGE_S3_REGION: ${STORAGE_S3_REGION}
STORAGE_S3_NAME: ${STORAGE_S3_NAME}
STORAGE_S3_ENDPOINT: ${STORAGE_S3_ENDPOINT}
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET}
LOGIN_TOKEN_SECRET: ${LOGIN_TOKEN_SECRET}
REFRESH_TOKEN_SECRET: ${REFRESH_TOKEN_SECRET}
FILE_TOKEN_SECRET: ${FILE_TOKEN_SECRET}
depends_on:
db:
condition: service_healthy
healthcheck:
test: curl --fail http://localhost:3000/healthz
interval: 5s
timeout: 5s
retries: 10
restart: always
db:
image: twentycrm/twenty-postgres:${TAG}
volumes:
- db-data:/bitnami/postgresql
ports:
- "5432:5432"
networks:
- twenty-network
environment:
POSTGRES_PASSWORD: ${POSTGRES_ADMIN_PASSWORD}
healthcheck:
test: pg_isready -U twenty -d default
interval: 5s
timeout: 5s
retries: 10
restart: always
volumes:
db-data:
server-local-data:
networks:
twenty-network:
driver: bridge
Here is my error
Unable to connect to the database (core). Retrying (9)...
Error: getaddrinfo ENOTFOUND db
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26)
[Nest] 1 - 06/12/2024, 11:23:55 AM ERROR [ExceptionHandler] getaddrinfo ENOTFOUND db
Error: getaddrinfo ENOTFOUND db
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26)
The documentation is not updated.
1 Reply
Hi @Ammar Ali, I believe the issue comes from your docker-compose networks config. Here is an up-to-date docker-compose: https://github.com/twentyhq/twenty/blob/main/packages/twenty-docker/docker-compose.yml
GitHub
twenty/packages/twenty-docker/docker-compose.yml at main · twentyhq...
Building a modern alternative to Salesforce, powered by the community. - twentyhq/twenty