Skip to content

Instantly share code, notes, and snippets.

@frankievalentine
Created September 30, 2024 19:15
Show Gist options
  • Save frankievalentine/fdda5e90db42262bcdcbfb4a3963bf00 to your computer and use it in GitHub Desktop.
Save frankievalentine/fdda5e90db42262bcdcbfb4a3963bf00 to your computer and use it in GitHub Desktop.
twentycrm-compose.yaml
services:
change-vol-ownership:
image: ubuntu
user: root
networks:
- twentycrm_default
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"
server:
image: twentycrm/twenty:latest
container_name: twentycrm
volumes:
- server-local-data:/app/packages/twenty-server/${STORAGE_LOCAL_PATH:-.local-storage}
- docker-data:/app/docker-data
ports:
- 3020:3000
networks:
- twentycrm_default
- database
- store
environment:
PORT: 3000
PG_DATABASE_URL: ${PG_DATABASE_URL}
SERVER_URL: ${SERVER_URL}
REACT_APP_SERVER_BASE_URL: ${REACT_APP_SERVER_BASE_URL}
FRONT_BASE_URL: ${FRONT_BASE_URL:-$SERVER_URL}
MESSAGE_QUEUE_TYPE: ${MESSAGE_QUEUE_TYPE}
ENABLE_DB_MIGRATIONS: "true"
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
REDIS_USERNAME: ${REDIS_USERNAME}
SIGN_IN_PREFILLED: ${SIGN_IN_PREFILLED}
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:
change-vol-ownership:
condition: service_completed_successfully
healthcheck:
test: curl --fail http://localhost:3000/healthz
interval: 5s
timeout: 5s
retries: 10
restart: always
worker:
image: twentycrm/twenty:latest
command:
- yarn
- worker:prod
networks:
- twentycrm_default
- database
- store
environment:
PG_DATABASE_URL: ${PG_DATABASE_URL}
SERVER_URL: ${SERVER_URL}
REACT_APP_SERVER_BASE_URL: ${REACT_APP_SERVER_BASE_URL}
FRONT_BASE_URL: ${FRONT_BASE_URL:-$SERVER_URL}
MESSAGE_QUEUE_TYPE: ${MESSAGE_QUEUE_TYPE}
ENABLE_DB_MIGRATIONS: "false" # it already runs on the server
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
REDIS_USERNAME: ${REDIS_USERNAME}
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:
server:
condition: service_healthy
restart: always
networks:
twentycrm_default:
external: true
database:
external: true
store:
external: true
volumes:
docker-data: null
db-data: null
server-local-data: null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment