-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add nginx based docker compose
- Loading branch information
1 parent
fb347b8
commit 5a3aff4
Showing
2 changed files
with
313 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# 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='<ENCRYPTION_KEY_MUST_BE_32_LONG>' | ||
|
||
|
||
# General | ||
# available values 'dev', 'test', 'production', 'ci', 'local' | ||
NODE_ENV=production | ||
|
||
# MongoDB | ||
MONGO_MAX_POOL_SIZE=500 | ||
MONGO_MIN_POOL_SIZE=100 | ||
MONGO_INITDB_ROOT_USERNAME=novu-selfhost | ||
MONGO_INITDB_ROOT_PASSWORD=qwertyuiop | ||
MONGO_URL=mongodb://novu-selfhost:qwertyuiop@mongodb:27017/novu-db?authSource=admin | ||
Check warning on line 18 in docker/local/deployment/nginx-based/.env.example GitHub Actions / Spell check
|
||
|
||
# REDIS | ||
REDIS_HOST=redis | ||
REDIS_PASSWORD= | ||
REDIS_CACHE_SERVICE_HOST= | ||
|
||
# AWS S3 | ||
S3_LOCAL_STACK=http://s3.eu-east-1.amazonaws.com | ||
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 | ||
WEB_PORT=4200 | ||
EMBED_PORT=4701 | ||
WIDGET_PORT=4500 | ||
|
||
# Hosts | ||
REACT_APP_WS_HOST=ws.novu.domain.com | ||
API_ROOT_HOST=api.novu.domain.com | ||
FRONT_BASE_HOST=novu.domain.com | ||
EMBED_HOST=embed.novu.domain.com | ||
WIDGET_HOST=widget.novu.domain.com | ||
|
||
# URLs | ||
REACT_APP_WS_URL=https://$REACT_APP_WS_HOST | ||
# 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=https://$API_ROOT_HOST | ||
FRONT_BASE_URL=https://$FRONT_BASE_HOST | ||
WIDGET_EMBED_PATH=https://$EMBED_HOST/embed.umd.min.js | ||
EMBED_URL=https://$EMBED_HOST | ||
WIDGET_URL=https://$WIDGET_HOST | ||
|
||
# Analytics | ||
SENTRY_DSN= | ||
# change these values | ||
NEW_RELIC_APP_NAME= | ||
NEW_RELIC_LICENSE_KEY= | ||
|
||
# Others | ||
LETSENCRYPT_EMAIL=[email protected] | ||
DISABLE_USER_REGISTRATION=false |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,245 @@ | ||
version: '3.9' | ||
services: | ||
redis: | ||
image: 'redis:alpine' | ||
container_name: redis | ||
restart: unless-stopped | ||
logging: | ||
driver: 'none' | ||
|
||
mongodb: | ||
image: mongo | ||
container_name: mongodb | ||
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 | ||
restart: unless-stopped | ||
|
||
api: | ||
image: 'ghcr.io/novuhq/novu/api:latest' | ||
depends_on: | ||
- mongodb | ||
- redis | ||
- nginx-proxy | ||
- nginx-proxy-acme | ||
container_name: api | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
max-file: '5' | ||
expose: | ||
- "${API_PORT}" | ||
environment: | ||
VIRTUAL_HOST: ${API_ROOT_HOST} | ||
VIRTUAL_PORT: ${API_PORT} | ||
LETSENCRYPT_HOST: ${API_ROOT_HOST} | ||
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL} | ||
Check warning on line 49 in docker/local/deployment/nginx-based/docker-compose.yml GitHub Actions / Spell check
|
||
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_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} | ||
|
||
worker: | ||
image: 'ghcr.io/novuhq/novu/worker:latest' | ||
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_MIN_POOL_SIZE: ${MONGO_MIN_POOL_SIZE} | ||
MONGO_MAX_POOL_SIZE: ${MONGO_MAX_POOL_SIZE} | ||
REDIS_HOST: ${REDIS_HOST} | ||
REDIS_PORT: ${REDIS_PORT} | ||
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} | ||
|
||
ws: | ||
image: 'ghcr.io/novuhq/novu/ws:latest' | ||
depends_on: | ||
- mongodb | ||
- redis | ||
- nginx-proxy | ||
- nginx-proxy-acme | ||
container_name: ws | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
max-file: '5' | ||
expose: | ||
- "${WS_PORT}" | ||
environment: | ||
VIRTUAL_HOST: ${REACT_APP_WS_HOST} | ||
VIRTUAL_PORT: ${WS_PORT} | ||
LETSENCRYPT_HOST: ${REACT_APP_WS_HOST} | ||
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL} | ||
PORT: ${WS_PORT} | ||
NODE_ENV: ${NODE_ENV} | ||
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} | ||
JWT_SECRET: ${JWT_SECRET} | ||
|
||
web: | ||
image: 'ghcr.io/novuhq/novu/web:latest' | ||
depends_on: | ||
- api | ||
- worker | ||
- nginx-proxy | ||
- nginx-proxy-acme | ||
container_name: web | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
max-file: '5' | ||
expose: | ||
- "${WEB_PORT}" | ||
environment: | ||
VIRTUAL_HOST: ${FRONT_BASE_HOST} | ||
VIRTUAL_PORT: ${WEB_PORT} | ||
LETSENCRYPT_HOST: ${FRONT_BASE_HOST} | ||
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL} | ||
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} | ||
|
||
widget: | ||
image: 'ghcr.io/novuhq/novu/widget:latest' | ||
depends_on: | ||
- api | ||
- worker | ||
- web | ||
- nginx-proxy | ||
- nginx-proxy-acme | ||
container_name: widget | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
max-file: '5' | ||
expose: | ||
- "${WIDGET_PORT}" | ||
environment: | ||
VIRTUAL_HOST: ${WIDGET_HOST} | ||
VIRTUAL_PORT: ${WIDGET_PORT} | ||
LETSENCRYPT_HOST: ${WIDGET_HOST} | ||
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL} | ||
REACT_APP_API_URL: ${API_ROOT_URL} | ||
REACT_APP_WS_URL: ${REACT_APP_WS_URL} | ||
REACT_APP_ENVIRONMENT: ${NODE_ENV} | ||
|
||
embed: | ||
depends_on: | ||
- widget | ||
- nginx-proxy | ||
- nginx-proxy-acme | ||
image: 'ghcr.io/novuhq/novu/embed:latest' | ||
container_name: embed | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
max-file: '5' | ||
expose: | ||
- "{EMBED_PORT}" | ||
environment: | ||
VIRTUAL_HOST: ${EMBED_HOST} | ||
VIRTUAL_PORT: ${EMBED_PORT} | ||
LETSENCRYPT_HOST: ${EMBED_HOST} | ||
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL} | ||
WIDGET_URL: ${WIDGET_URL} | ||
|
||
nginx-proxy: | ||
image: nginxproxy/nginx-proxy | ||
container_name: nginx-proxy | ||
restart: always | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
volumes: | ||
- certs:/etc/nginx/certs | ||
- vhost:/etc/nginx/vhost.d | ||
- html:/usr/share/nginx/html | ||
- /var/run/docker.sock:/tmp/docker.sock:ro | ||
|
||
nginx-proxy-acme: | ||
image: nginxproxy/acme-companion | ||
container_name: nginx-proxy-acme | ||
restart: always | ||
volumes_from: | ||
- nginx-proxy | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock:ro | ||
- acme:/etc/acme.sh | ||
environment: | ||
- DEFAULT_EMAIL=${LETSENCRYPT_EMAIL} | ||
- NGINX_PROXY_CONTAINER=nginx-proxy | ||
depends_on: | ||
- nginx-proxy | ||
|
||
|
||
volumes: | ||
mongodb: | ||
certs: | ||
vhost: | ||
html: | ||
acme: |