From 4c9ba007b53a1cf6dcb1e8cf1604c7fb0092ad7a Mon Sep 17 00:00:00 2001 From: Pawan Jain Date: Thu, 13 Jun 2024 00:12:53 +0530 Subject: [PATCH] fix: bring back comunity self hostdocker compose file (#5718) --- docker/community/.env.example | 66 ++++++ docker/community/docker-compose.yml | 188 ++++++++++++++++++ docker/enterprise/.env.example | 2 + ...pose.enterprise.yml => docker-compose.yml} | 0 4 files changed, 256 insertions(+) create mode 100644 docker/community/.env.example create mode 100644 docker/community/docker-compose.yml rename docker/enterprise/{docker-compose.enterprise.yml => docker-compose.yml} (100%) diff --git a/docker/community/.env.example b/docker/community/.env.example new file mode 100644 index 00000000000..a6b2b217ae5 --- /dev/null +++ b/docker/community/.env.example @@ -0,0 +1,66 @@ +# Secrets +# YOU MUST CHANGE THESE BEFORE GOING INTO PRODUCTION +# used as a secret to verify the JWT token signature +JWT_SECRET=your-secret +# used to encrypt/decrypt the provider credentials +STORE_ENCRYPTION_KEY= + +# Host +HOST_NAME=http://localhost + +# General +# available values 'dev', 'test', 'production', 'ci', 'local' +NODE_ENV=local +MONGO_MAX_POOL_SIZE=200 +MONGO_MIN_POOL_SIZE=100 +# MONGO USER +MONGO_INITDB_ROOT_USERNAME=root +# MONGO PASSWORD +MONGO_INITDB_ROOT_PASSWORD=secret +MONGO_URL=mongodb://root:secret@mongodb:27017/novu-db?authSource=admin +REDIS_HOST=redis + +DOCKER_REDIS_SERVICE_PORT=6379 +REDIS_PASSWORD= +REDIS_CACHE_SERVICE_HOST= + +# AWS +S3_LOCAL_STACK=$HOST_NAME:4566 +S3_BUCKET_NAME=novu-local +S3_REGION=us-east-1 +AWS_ACCESS_KEY_ID=test +AWS_SECRET_ACCESS_KEY=test + +# Ports +API_PORT=3000 +REDIS_PORT=6379 +REDIS_CACHE_SERVICE_PORT=6379 +WS_PORT=3002 + +# Root URL +REACT_APP_WS_URL=$HOST_NAME:3002 +# Uncomment this one when deploying Novu in the local environment +# as Web app local Dockerfile will have to load this to be used. +# Deployment version doesn't need as we inject it with API_ROOT_URL value. +# REACT_APP_API_URL=http://localhost:3000 +API_ROOT_URL=$HOST_NAME:3000 +DISABLE_USER_REGISTRATION=false +FRONT_BASE_URL=$HOST_NAME:4200 +WIDGET_EMBED_PATH=$HOST_NAME:4701/embed.umd.min.js +WIDGET_URL=$HOST_NAME:4500 + +# Context Paths +# Only needed for setups with reverse-proxies +GLOBAL_CONTEXT_PATH= +WEB_CONTEXT_PATH= +API_CONTEXT_PATH= +WS_CONTEXT_PATH= +WIDGET_CONTEXT_PATH= + +# Analytics +SENTRY_DSN= +# change these values +NEW_RELIC_APP_NAME= +NEW_RELIC_LICENSE_KEY= + +IS_MULTI_TENANCY_ENABLED=true diff --git a/docker/community/docker-compose.yml b/docker/community/docker-compose.yml new file mode 100644 index 00000000000..6e4a8481670 --- /dev/null +++ b/docker/community/docker-compose.yml @@ -0,0 +1,188 @@ +version: '3.9' +name: novu +services: + redis: + image: 'redis:alpine' + container_name: redis + restart: unless-stopped + logging: + driver: 'none' + mongodb: + image: mongo + container_name: mongodb + restart: unless-stopped + logging: + driver: 'json-file' + options: + max-size: '50m' + max-file: '5' + environment: + - PUID=1000 + - PGID=1000 + - MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME} + - MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD} + volumes: + - mongodb:/data/db + ports: + - 27017:27017 + api: + image: 'ghcr.io/novuhq/novu/api:0.24.0' + depends_on: + - mongodb + - redis + container_name: api + restart: unless-stopped + logging: + driver: 'json-file' + options: + max-size: '50m' + max-file: '5' + environment: + NODE_ENV: ${NODE_ENV} + API_ROOT_URL: ${API_ROOT_URL} + DISABLE_USER_REGISTRATION: ${DISABLE_USER_REGISTRATION} + PORT: ${API_PORT} + FRONT_BASE_URL: ${FRONT_BASE_URL} + MONGO_URL: ${MONGO_URL} + MONGO_MIN_POOL_SIZE: ${MONGO_MIN_POOL_SIZE} + MONGO_MAX_POOL_SIZE: ${MONGO_MAX_POOL_SIZE} + REDIS_HOST: ${REDIS_HOST} + REDIS_PORT: ${REDIS_PORT} + REDIS_PASSWORD: ${REDIS_PASSWORD} + REDIS_DB_INDEX: 2 + REDIS_CACHE_SERVICE_HOST: ${REDIS_CACHE_SERVICE_HOST} + REDIS_CACHE_SERVICE_PORT: ${REDIS_CACHE_SERVICE_PORT} + S3_LOCAL_STACK: ${S3_LOCAL_STACK} + S3_BUCKET_NAME: ${S3_BUCKET_NAME} + S3_REGION: ${S3_REGION} + AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} + AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} + JWT_SECRET: ${JWT_SECRET} + STORE_ENCRYPTION_KEY: ${STORE_ENCRYPTION_KEY} + SENTRY_DSN: ${SENTRY_DSN} + NEW_RELIC_APP_NAME: ${NEW_RELIC_APP_NAME} + NEW_RELIC_LICENSE_KEY: ${NEW_RELIC_LICENSE_KEY} + API_CONTEXT_PATH: ${API_CONTEXT_PATH} + IS_MULTI_TENANCY_ENABLED: ${IS_MULTI_TENANCY_ENABLED} + ports: + - '3000:3000' + worker: + image: 'ghcr.io/novuhq/novu/worker:0.24.0' + depends_on: + - mongodb + - redis + container_name: worker + restart: unless-stopped + logging: + driver: 'json-file' + options: + max-size: '50m' + max-file: '5' + environment: + NODE_ENV: ${NODE_ENV} + MONGO_URL: ${MONGO_URL} + MONGO_MAX_POOL_SIZE: ${MONGO_MAX_POOL_SIZE} + REDIS_HOST: ${REDIS_HOST} + REDIS_PORT: ${REDIS_PORT} + REDIS_PASSWORD: ${REDIS_PASSWORD} + REDIS_DB_INDEX: 2 + REDIS_CACHE_SERVICE_HOST: ${REDIS_CACHE_SERVICE_HOST} + REDIS_CACHE_SERVICE_PORT: ${REDIS_CACHE_SERVICE_PORT} + S3_LOCAL_STACK: ${S3_LOCAL_STACK} + S3_BUCKET_NAME: ${S3_BUCKET_NAME} + S3_REGION: ${S3_REGION} + AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} + AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} + STORE_ENCRYPTION_KEY: ${STORE_ENCRYPTION_KEY} + SENTRY_DSN: ${SENTRY_DSN} + NEW_RELIC_APP_NAME: ${NEW_RELIC_APP_NAME} + NEW_RELIC_LICENSE_KEY: ${NEW_RELIC_LICENSE_KEY} + BROADCAST_QUEUE_CHUNK_SIZE: ${BROADCAST_QUEUE_CHUNK_SIZE} + MULTICAST_QUEUE_CHUNK_SIZE: ${MULTICAST_QUEUE_CHUNK_SIZE} + IS_MULTI_TENANCY_ENABLED: ${IS_MULTI_TENANCY_ENABLED} + ws: + image: 'ghcr.io/novuhq/novu/ws:0.24.0' + depends_on: + - mongodb + - redis + container_name: ws + restart: unless-stopped + logging: + driver: 'json-file' + options: + max-size: '50m' + max-file: '5' + environment: + PORT: ${WS_PORT} + NODE_ENV: ${NODE_ENV} + MONGO_URL: ${MONGO_URL} + MONGO_MAX_POOL_SIZE: ${MONGO_MAX_POOL_SIZE} + REDIS_HOST: ${REDIS_HOST} + REDIS_PORT: ${REDIS_PORT} + REDIS_PASSWORD: ${REDIS_PASSWORD} + JWT_SECRET: ${JWT_SECRET} + WS_CONTEXT_PATH: ${WS_CONTEXT_PATH} + NEW_RELIC_APP_NAME: ${NEW_RELIC_APP_NAME} + NEW_RELIC_LICENSE_KEY: ${NEW_RELIC_LICENSE_KEY} + ports: + - '3002:3002' + web: + image: 'ghcr.io/novuhq/novu/web:0.24.0' + depends_on: + - api + - worker + container_name: web + restart: unless-stopped + logging: + driver: 'json-file' + options: + max-size: '50m' + max-file: '5' + environment: + REACT_APP_API_URL: ${API_ROOT_URL} + REACT_APP_ENVIRONMENT: ${NODE_ENV} + REACT_APP_WIDGET_EMBED_PATH: ${WIDGET_EMBED_PATH} + REACT_APP_DOCKER_HOSTED_ENV: 'true' + REACT_APP_WS_URL: ${REACT_APP_WS_URL} + IS_MULTI_TENANCY_ENABLED: ${IS_MULTI_TENANCY_ENABLED} + ports: + - 4200:4200 + widget: + image: 'ghcr.io/novuhq/novu/widget:0.24.0' + depends_on: + - api + - worker + - web + container_name: widget + restart: unless-stopped + logging: + driver: 'json-file' + options: + max-size: '50m' + max-file: '5' + environment: + REACT_APP_API_URL: ${API_ROOT_URL} + REACT_APP_WS_URL: ${REACT_APP_WS_URL} + REACT_APP_ENVIRONMENT: ${NODE_ENV} + WIDGET_CONTEXT_PATH: ${WIDGET_CONTEXT_PATH} + ports: + - 4500:4500 + embed: + depends_on: + - widget + image: 'ghcr.io/novuhq/novu/embed:0.24.0' + container_name: embed + restart: unless-stopped + logging: + driver: 'json-file' + options: + max-size: '50m' + max-file: '5' + environment: + WIDGET_URL: ${WIDGET_URL} + NEW_RELIC_APP_NAME: ${NEW_RELIC_APP_NAME} + NEW_RELIC_LICENSE_KEY: ${NEW_RELIC_LICENSE_KEY} + ports: + - 4701:4701 +volumes: + mongodb: ~ diff --git a/docker/enterprise/.env.example b/docker/enterprise/.env.example index 1be4129b2d9..02c7171979a 100644 --- a/docker/enterprise/.env.example +++ b/docker/enterprise/.env.example @@ -60,3 +60,5 @@ SENTRY_DSN= # change these values NEW_RELIC_APP_NAME= NEW_RELIC_LICENSE_KEY= + +IS_MULTI_TENANCY_ENABLED=true diff --git a/docker/enterprise/docker-compose.enterprise.yml b/docker/enterprise/docker-compose.yml similarity index 100% rename from docker/enterprise/docker-compose.enterprise.yml rename to docker/enterprise/docker-compose.yml