Environment Variables
Before deploying OCS.io, you need to set various environment variables in a file named ocs_deployment.env
. This file will contain crucial configurations that tailor the deployment to your specific requirements.
Here is an example of the ocs_deployment.env
file:
#### DEPLOYMENT ENV FILE ####
# Registry
REGISTRY=europe-west3-docker.pkg.dev/resources-ocs-io/demo
# DNS
DNS_DB_SERVER=ocs-db-server # DNS of the OCS database
DNS_CACHE_SERVER=ocs-cache-server # DNS of the OCS REDIS
DNS_RABBITMQ=ocs-rabbitmq # DNS of the OCS RabbitMQ
DNS_OCS_CONFIG_SERVER=ocs-config-server # DNS of the OCS Config Server
DNS_OCS_CASM_SERVER=ocs-casm-server # DNS of the OCS CASM Server
DNS_OCS_BILLING_SERVER=ocs-billing-server # DNS of the OCS Billing Server
DNS_OCS_APP_UPDATER=ocs-app-updater # DNS of the OCS App Updater
DNS_OCS_DATA_EXTRACTOR=ocs-data-extractor # DNS of the OCS Data Extractor
DNS_OCS_EDR_PROCESSOR=ocs-edr-processor # DNS of the OCS EDR Processor
# Deployment
# == PostgreSQL ==
POSTGRES_DATABASE=ocs # Name of the OCS database
POSTGRES_USERNAME=ocs # Username to the OCS database
POSTGRES_PASSWORD=ocspwd # Password to the OCS database
POSTGRES_SCHEMA=ocs # Schema in the OCS database
POSTGRES_PORT_EXT=5433 # Port of the OCS database which will be exposed to external systems
POSTGRES_PORT_INT=5432 # Internal Port of the OCS database
POSTGRES_COLLATE=en_US.utf8 # Collation of the OCS database
POSTGRES_CTYPE=en_US.utf8 # Collation Type of the OCS database
# == Redis ==
REDIS_PORT_EXT=6379 # Port of the OCS REDIS which will be exposed to external systems
REDIS_PORT_INT=6379 # Internal Port of the OCS REDIS
# == RabbitMQ ==
RABBIT_USERNAME=ocs # Username to the OCS RabbitMQ
RABBIT_PASSWORD=ocspwd # Password of the OCS RabbitMQ
RABBIT_PORT_EXT=5672 # Port of the OCS RabbitMQ which will be exposed to external systems
RABBIT_PORT_INT=5672 # Internal Port of the OCS RabbitMQ
RABBIT_MGMT_PORT_EXT=15672 # Port of the OCS RabbitMQ's Management Console which bill be exposed to external systems
RABBIT_MGMT_PORT_INT=15672 # Internal Port of the OCS RabbitMQ's Management Console
# == NGINX ==
NGINX_SSL_DIR=/etc/letsencrypt/live/example.com # Directory containing SSL certificates and Private key for NGINX
NGINX_PORT_EXT=80 # Port of the NGINX which will be exposed to external systems
NGINX_PORT_INT=80 # Internal Port of the NGINX
NGINX_SEC_PORT_EXT=443 # Secured Port of the NGINX which will be exposed to external systems
NGINX_SEC_PORT_INT=443 # Secured Internal Port of the NGINX
# == Filesystem ==
FS_POSTGRES_DATA=/app/pgsql/data # Mounted File System for OCS database files
FS_OCS_DATA=/app/ocs/data # Mounted File System for Echange of files between OCS and other systems
# == OCS JAVA APPs ==
# -- application config
OCS_ENVIRONMENT=prod # Environment of the OCS deployment (prod, test, dev, etc.)
OCS_PREFIX=demo # Prefix of the OCS deployment
OCS_DEPLOYMENT_ID=dP # ID (prefix) of the OCS deployment
[email protected] # Manager's username of the OCS deployment
[email protected] # Platform's APP ID (used for internal processes)
OCS_PLATFORM_API_KEY=s3cr3tKey! # Platform's API KEY (used for internal processes)
OCS_PLATFORM_TIME_ZONE=Europe/Prague # Platform's Time Zone (used for internal processes)
# -- domains & ports
OCS_CONFIG_SERVER_DOMAIN_NAME=configure.example.com # Name of the domain on which Config Server is deployed
OCS_CONFIG_SERVER_PORT_EXT=8080 # Port of the OCS Config Server which will be exposed to external systems
OCS_CONFIG_SERVER_PORT_INT=8880 # Internal Port of the OCS Config Server
OCS_CASM_SERVER_DOMAIN_NAME=api.example.com # Name of the domain on which CASM Server is deployed
OCS_CASM_SERVER_PORT_EXT=8081 # Port of the OCS CASM Server which will be exposed to external systems
OCS_CASM_SERVER_PORT_INT=8881 # Internal Port of the OCS CASM Server
OCS_BILLING_SERVER_PORT_EXT=8082 # Port of the OCS Billing Server which will be exposed to external systems
OCS_BILLING_SERVER_PORT_INT=8882 # Internal Port of the OCS Billing Server
OCS_DATA_EXTRACTOR_PORT_EXT=8083 # Port of the OCS Data Extractor which will be exposed to external systems
OCS_DATA_EXTRACTOR_PORT_INT=8883 # Internal Port of the OCS Data Extractor
OCS_EDR_PROCESSOR_PORT_EXT=8084 # Port of the OCS EDR Processor which will be exposed to external systems
OCS_EDR_PROCESSOR_PORT_INT=8884 # Internal Port of the OCS EDR Processor
All variables must be set. |
Once you have prepared the ocs_deployment.env
file with the necessary environment variables, you can proceed to set these variables. To do this, execute the following commands:
set -a
source ocs_deployment.env
These commands ensure that the environment variables are correctly loaded, making them accessible for the deployment process. Be sure to customize the variables in the ocs_deployment.env
file according to your deployment needs.