mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-23 20:13:21 +03:00
e4959ad534
In this PR: - update your environment variables to default `CACHE_STORAGE_TYPE` to `redis` and `MESSAGE_QUEUE_TYPE` to `bull-mq` - add redis container to our default docker-compose - add `REDIS_HOST` and `REDIS_PORT` to docker-compose yaml - add upgrade instructions
106 lines
2.8 KiB
YAML
106 lines
2.8 KiB
YAML
version: "3.9"
|
|
name: twenty
|
|
|
|
services:
|
|
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"
|
|
|
|
server:
|
|
image: twentycrm/twenty:${TAG}
|
|
volumes:
|
|
- server-local-data:/app/packages/twenty-server/${STORAGE_LOCAL_PATH:-.local-storage}
|
|
- docker-data:/app/docker-data
|
|
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}
|
|
REDIS_PORT: ${REDIS_PORT:-6379}
|
|
REDIS_HOST: ${REDIS_HOST:-redis}
|
|
|
|
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:
|
|
change-vol-ownership:
|
|
condition: service_completed_successfully
|
|
db:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: curl --fail http://localhost:3000/healthz
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
restart: always
|
|
|
|
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}
|
|
REDIS_PORT: ${REDIS_PORT:-6379}
|
|
REDIS_HOST: ${REDIS_HOST:-redis}
|
|
|
|
ENABLE_DB_MIGRATIONS: "false" # it already runs on the server
|
|
|
|
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
|
|
server:
|
|
condition: service_healthy
|
|
restart: always
|
|
|
|
db:
|
|
image: twentycrm/twenty-postgres:${TAG}
|
|
volumes:
|
|
- db-data:/bitnami/postgresql
|
|
environment:
|
|
POSTGRES_PASSWORD: ${POSTGRES_ADMIN_PASSWORD}
|
|
healthcheck:
|
|
test: pg_isready -U twenty -d default
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
restart: always
|
|
|
|
redis:
|
|
image: redis
|
|
ports:
|
|
- "6379:6379"
|
|
restart: always
|
|
|
|
volumes:
|
|
docker-data:
|
|
db-data:
|
|
server-local-data:
|