2024-03-29 17:25:41 +03:00
|
|
|
version: "3.9"
|
2024-03-22 11:16:39 +03:00
|
|
|
name: twenty
|
|
|
|
|
|
|
|
services:
|
2024-06-12 22:17:31 +03:00
|
|
|
change-vol-ownership:
|
|
|
|
image: ubuntu
|
|
|
|
user: root
|
|
|
|
volumes:
|
|
|
|
- server-local-data:/tmp/server-local-data
|
|
|
|
- docker-data:/tmp/docker-data
|
|
|
|
command: >
|
|
|
|
bash -c "
|
|
|
|
chown -R 1000:1000 /tmp/server-local-data
|
|
|
|
&& chown -R 1000:1000 /tmp/docker-data"
|
|
|
|
|
2024-03-22 11:16:39 +03:00
|
|
|
server:
|
|
|
|
image: twentycrm/twenty:${TAG}
|
|
|
|
volumes:
|
2024-06-12 22:17:31 +03:00
|
|
|
- server-local-data:/app/packages/twenty-server/${STORAGE_LOCAL_PATH:-.local-storage}
|
|
|
|
- docker-data:/app/docker-data
|
2024-03-22 11:16:39 +03:00
|
|
|
ports:
|
|
|
|
- "3000:3000"
|
|
|
|
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}
|
2024-05-31 14:29:58 +03:00
|
|
|
MESSAGE_QUEUE_TYPE: ${MESSAGE_QUEUE_TYPE}
|
2024-03-22 11:16:39 +03:00
|
|
|
|
2024-03-29 17:25:41 +03:00
|
|
|
ENABLE_DB_MIGRATIONS: "true"
|
2024-03-22 11:16:39 +03:00
|
|
|
|
|
|
|
SIGN_IN_PREFILLED: ${SIGN_IN_PREFILLED}
|
2024-03-27 23:28:03 +03:00
|
|
|
STORAGE_TYPE: ${STORAGE_TYPE}
|
|
|
|
STORAGE_S3_REGION: ${STORAGE_S3_REGION}
|
|
|
|
STORAGE_S3_NAME: ${STORAGE_S3_NAME}
|
|
|
|
STORAGE_S3_ENDPOINT: ${STORAGE_S3_ENDPOINT}
|
2024-03-22 11:16:39 +03:00
|
|
|
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET}
|
|
|
|
LOGIN_TOKEN_SECRET: ${LOGIN_TOKEN_SECRET}
|
|
|
|
REFRESH_TOKEN_SECRET: ${REFRESH_TOKEN_SECRET}
|
2024-03-26 15:42:09 +03:00
|
|
|
FILE_TOKEN_SECRET: ${FILE_TOKEN_SECRET}
|
2024-03-22 11:16:39 +03:00
|
|
|
depends_on:
|
2024-06-12 22:17:31 +03:00
|
|
|
change-vol-ownership:
|
|
|
|
condition: service_completed_successfully
|
2024-03-22 11:16:39 +03:00
|
|
|
db:
|
|
|
|
condition: service_healthy
|
|
|
|
healthcheck:
|
2024-03-27 23:28:03 +03:00
|
|
|
test: curl --fail http://localhost:3000/healthz
|
2024-03-22 11:16:39 +03:00
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 10
|
|
|
|
restart: always
|
|
|
|
|
2024-05-31 14:29:58 +03:00
|
|
|
worker:
|
|
|
|
image: twentycrm/twenty:${TAG}
|
|
|
|
command: ["yarn", "worker:prod"]
|
|
|
|
environment:
|
|
|
|
PG_DATABASE_URL: postgres://twenty:twenty@${PG_DATABASE_HOST}/default
|
|
|
|
SERVER_URL: ${SERVER_URL}
|
|
|
|
FRONT_BASE_URL: ${FRONT_BASE_URL:-$SERVER_URL}
|
|
|
|
MESSAGE_QUEUE_TYPE: ${MESSAGE_QUEUE_TYPE}
|
|
|
|
|
2024-06-12 22:17:31 +03:00
|
|
|
ENABLE_DB_MIGRATIONS: "false" # it already runs on the server
|
2024-05-31 14:29:58 +03:00
|
|
|
|
|
|
|
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
|
2024-06-12 22:17:31 +03:00
|
|
|
server:
|
|
|
|
condition: service_healthy
|
2024-05-31 14:29:58 +03:00
|
|
|
restart: always
|
|
|
|
|
2024-03-22 11:16:39 +03:00
|
|
|
db:
|
|
|
|
image: twentycrm/twenty-postgres:${TAG}
|
|
|
|
volumes:
|
2024-03-27 10:47:58 +03:00
|
|
|
- db-data:/bitnami/postgresql
|
2024-03-22 11:16:39 +03:00
|
|
|
environment:
|
|
|
|
POSTGRES_PASSWORD: ${POSTGRES_ADMIN_PASSWORD}
|
|
|
|
healthcheck:
|
2024-03-27 23:28:03 +03:00
|
|
|
test: pg_isready -U twenty -d default
|
2024-03-22 11:16:39 +03:00
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 10
|
|
|
|
restart: always
|
|
|
|
|
|
|
|
volumes:
|
2024-06-12 22:17:31 +03:00
|
|
|
docker-data:
|
2024-03-22 11:16:39 +03:00
|
|
|
db-data:
|
|
|
|
server-local-data:
|