Created
March 5, 2025 11:42
-
-
Save kuldar/1cdfb6a5cded1109c60ba521bd139b51 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# documentation: https://twenty.com/developers/section/self-hosting/docker-compose | |
# slogan: Twenty is a CRM designed to fit your unique business needs. | |
# tags: crm, self-hosted, dashboard | |
# logo: svgs/twenty.svg | |
# port: 3000 | |
services: | |
change-vol-ownership: | |
image: ubuntu | |
user: root | |
restart: "no" | |
exclude_from_hc: true | |
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 && | |
echo 'Volume ownership changed successfully'" | |
server: | |
image: twentycrm/twenty:${TWENTY_VERSION:-latest} | |
volumes: | |
- server-local-data:/app/packages/twenty-server/.local-storage | |
- docker-data:/app/docker-data | |
environment: | |
- SERVICE_FQDN_SERVER_3000 | |
- NODE_PORT=3000 | |
- PG_DATABASE_URL=postgres://postgres:$SERVICE_PASSWORD_POSTGRES@db:5432/default | |
- FRONTEND_URL=$SERVICE_FQDN_SERVER | |
- SERVER_URL=$SERVICE_FQDN_SERVER | |
- REDIS_URL=redis://redis:6379 | |
# Required setting for successful startup | |
- SIGN_IN_PREFILLED=true | |
# Storage configuration | |
- STORAGE_TYPE=${STORAGE_TYPE:-local} | |
- STORAGE_S3_REGION=${STORAGE_S3_REGION} | |
- STORAGE_S3_NAME=${STORAGE_S3_NAME} | |
- STORAGE_S3_ENDPOINT=${STORAGE_S3_ENDPOINT} | |
# Security | |
- APP_SECRET=$SERVICE_BASE64_32_SECRET | |
depends_on: | |
change-vol-ownership: | |
condition: service_completed_successfully | |
db: | |
condition: service_healthy | |
healthcheck: | |
test: curl --fail http://localhost:3000/healthz || exit 1 | |
interval: 10s | |
timeout: 5s | |
retries: 30 | |
start_period: 40s | |
worker: | |
image: twentycrm/twenty:${TWENTY_VERSION:-latest} | |
command: ["yarn", "worker:prod"] | |
volumes: | |
- server-local-data:/app/packages/twenty-server/.local-storage | |
- docker-data:/app/docker-data | |
environment: | |
- PG_DATABASE_URL=postgres://postgres:$SERVICE_PASSWORD_POSTGRES@db:5432/default | |
- SERVER_URL=$SERVICE_FQDN_SERVER | |
- REDIS_URL=redis://redis:6379 | |
- DISABLE_DB_MIGRATIONS=true | |
# Storage configuration | |
- STORAGE_TYPE=${STORAGE_TYPE:-local} | |
- STORAGE_S3_REGION=${STORAGE_S3_REGION} | |
- STORAGE_S3_NAME=${STORAGE_S3_NAME} | |
- STORAGE_S3_ENDPOINT=${STORAGE_S3_ENDPOINT} | |
# Security | |
- APP_SECRET=$SERVICE_BASE64_32_SECRET | |
depends_on: | |
db: | |
condition: service_healthy | |
server: | |
condition: service_healthy | |
db: | |
image: postgres:16 | |
volumes: | |
- db-data:/var/lib/postgresql/data | |
environment: | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES | |
healthcheck: | |
test: pg_isready -U postgres -h localhost -d default | |
interval: 5s | |
timeout: 5s | |
retries: 10 | |
redis: | |
image: redis | |
volumes: | |
- redis-data:/data | |
healthcheck: | |
test: ["CMD", "redis-cli", "ping"] | |
interval: 5s | |
timeout: 5s | |
retries: 10 | |
volumes: | |
db-data: | |
redis-data: | |
server-local-data: | |
docker-data: |
The first one that worked, thanks
Worked great, thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Worked first try ! Thank you so much 🙏