Ammar Ali
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.
2 replies
how to setup locally with docker.
I am running with docker. but it requires some env setup. what things should be there.
here is my env inside twenty-docker directory.
TAG=latest
POSTGRES_ADMIN_PASSWORD=replace_me_with_a_strong_password
PG_DATABASE_HOST=db:5432
SERVER_URL=http://localhost:3000
Uncoment if you are serving your front on another server than the API (eg. bucket)
FRONT_BASE_URL=http://localhost:3000
Use openssl rand -base64 32 for each secret
ACCESS_TOKEN_SECRET=replace_me_with_a_random_string_access
LOGIN_TOKEN_SECRET=replace_me_with_a_random_string_login
REFRESH_TOKEN_SECRET=replace_me_with_a_random_string_refresh
FILE_TOKEN_SECRET=replace_me_with_a_random_string_refresh
SIGN_IN_PREFILLED=true
STORAGE_TYPE=local
STORAGE_S3_REGION=eu-west3
STORAGE_S3_NAME=my-bucket
STORAGE_S3_ENDPOINT=
2 replies
Create Standard object ids
I want to know how can i create standard object ids if i want to add my own object as well. Below are the. id's
export const STANDARD_OBJECT_IDS = {
activityTarget: '20202020-2945-440e-8d1a-f84672d33d5e',
activity: '20202020-39aa-4a89-843b-eb5f2a8b677f',
apiKey: '20202020-4c00-401d-8cda-ec6a4c41cd7d',
attachment: '20202020-bd3d-4c60-8dca-571c71d4447a',
blocklist: '20202020-0408-4f38-b8a8-4d5e3e26e24d',
behavioralEvent: '20202020-983d-416b-a5ee-bdd0da3d0f8f',
calendarChannelEventAssociation: '20202020-491b-4aaa-9825-afd1bae6ae00',
calendarChannel: '20202020-e8f2-40e1-a39c-c0e0039c5034',
calendarEventParticipant: '20202020-a1c3-47a6-9732-27e5b1e8436d',
calendarEvent: '20202020-8f1d-4eef-9f85-0d1965e27221',
comment: '20202020-435f-4de9-89b5-97e32233bf5f',
company: '20202020-b374-4779-a561-80086cb2e17f',
connectedAccount: '20202020-977e-46b2-890b-c3002ddfd5c5',
favorite: '20202020-ab56-4e05-92a3-e2414a499860',
auditLog: '20202020-0566-476a-b4c4-a0f9781bd80a',
messageChannelMessageAssociation: '20202020-ad1e-4127-bccb-d83ae04d2ccb',
messageChannel: '20202020-fe8c-40bc-a681-b80b771449b7',
messageParticipant: '20202020-a433-4456-aa2d-fd9cb26b774a',
messageThread: '20202020-849a-4c3e-84f5-a25a7d802271',
message: '20202020-3f6b-4425-80ab-e468899ab4b2',
opportunity: '20202020-9549-49dd-b2b2-883999db8938',
person: '20202020-e674-48e5-a542-72570eee7213',
timelineActivity: '20202020-6736-4337-b5c4-8b39fae325a5',
viewField: '20202020-4d19-4655-95bf-b2a04cf206d4',
viewFilter: '20202020-6fb6-4631-aded-b7d67e952ec8',
viewSort: '20202020-e46a-47a8-939a-e5d911f83531',
view: '20202020-722e-4739-8e2c-0c372d661f49',
webhook: '20202020-be4d-4e08-811d-0fffcd13ffd4',
workspaceMember: '20202020-3319-4234-a34c-82d5c0e881a6',
};
3 replies