Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

compose changes

Ahmed Essame0a7a23850b7
diff --git a/.env.example b/.env.example
index c3ccccd3..6ec9c498 100644
--- a/.env.example
+++ b/.env.example
@@ -1,14 +1,16 @@
NODE_ENV="development"
+
+
DATABASE_PROVIDER=mysql
DATABASE_HOST=localhost
-DATABASE_USER=root
+# Database username. any string is allowed except "root" since it is reserved for root user.
+DATABASE_USER=smythos_user
DATABASE_PASSWORD=samplepassword111
DATABASE_NAME=smythos-local
# Expansion to build the database url (this entry is MANDATORY for Prisma to work)
DATABASE_URL="$DATABASE_PROVIDER://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOST:3306/$DATABASE_NAME?allowPublicKeyRetrieval=true&useSSL=false"
-
DEFAULT_AGENT_DOMAIN="localagent.stage.smyth.ai" # staging agents domain
PROD_AGENT_DOMAIN="localagent.stage.smyth.ai" # deployed / prod agent domain
APP_DOMAIN="http://localhost:5050"
@@ -18,3 +20,9 @@ APP_DEV_SERVER_PORT="4001"
RUNTIME_PORT="5053"
APP_PORT="5050"
OPENAI_API_KEY="openai-api-key"
+
+
+# enable this to use redis
+# REDIS_HOST=redis
+# REDIS_PORT=6379
+# REDIS_PASSWORD=redis_password
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
index b9ce7a91..df0e7c7b 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -6,18 +6,20 @@ services:
image: mysql:8.0
container_name: smythos-mysql
restart: unless-stopped
+ env_file:
+ - .env
environment:
- MYSQL_ROOT_PASSWORD: smythos_root_password
- MYSQL_DATABASE: smythos_db
- MYSQL_USER: smythos_user
- MYSQL_PASSWORD: smythos_password
+ MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-$$(openssl rand -base64 32)}
+ MYSQL_DATABASE: ${DATABASE_NAME:-smythos_db}
+ MYSQL_USER: ${DATABASE_USER:-smythos_user}
+ MYSQL_PASSWORD: ${DATABASE_PASSWORD:-smythos_password}
volumes:
- mysql_data:/var/lib/mysql
networks:
- smythos-network
command: --default-authentication-plugin=mysql_native_password
healthcheck:
- test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-psmythos_root_password"]
+ test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "${DATABASE_USER:-smythos_user}", "-p${DATABASE_PASSWORD:-smythos_password}"]
interval: 10s
timeout: 5s
retries: 5
@@ -32,9 +34,25 @@ services:
- redis_data:/data
networks:
- smythos-network
- command: redis-server --appendonly yes
+ env_file:
+ - .env
+ command: >
+ sh -c "
+ if [ -n '${REDIS_PASSWORD:-}' ]; then
+ redis-server --appendonly yes --requirepass '${REDIS_PASSWORD}'
+ else
+ redis-server --appendonly yes
+ fi
+ "
healthcheck:
- test: ["CMD", "redis-cli", "ping"]
+ test: >
+ sh -c "
+ if [ -n '${REDIS_PASSWORD:-}' ]; then
+ redis-cli -a '${REDIS_PASSWORD}' ping
+ else
+ redis-cli ping
+ fi
+ "
interval: 10s
timeout: 3s
retries: 5
@@ -53,13 +71,12 @@ services:
env_file:
- .env
environment:
- # Override database URL to use internal MySQL container
- DATABASE_URL: mysql://smythos_user:smythos_password@mysql:3306/smythos_db
+ # Override database URL to use internal MySQL container with dynamic credentials
+ DATABASE_URL: mysql://${DATABASE_USER:-smythos_user}:${DATABASE_PASSWORD:-smythos_password}@mysql:3306/${DATABASE_NAME:-smythos_db}
# Override Redis to use internal Redis container (standalone mode)
- REDIS_HOST: redis
- REDIS_PORT: 6379
- REDIS_SENTINEL_HOSTS: ""
- REDIS_MASTER_NAME: ""
+ REDIS_HOST: ${REDIS_HOST:-redis}
+ REDIS_PORT: ${REDIS_PORT:-6379}
+ REDIS_PASSWORD: ${REDIS_PASSWORD:-}
volumes:
- smythos_data:/root/smythos-data
diff --git a/packages/app/src/backend/config.ts b/packages/app/src/backend/config.ts
index 8433f2de..8c7860d0 100644
--- a/packages/app/src/backend/config.ts
+++ b/packages/app/src/backend/config.ts
@@ -88,7 +88,7 @@ const config = {
},
flags: {
- useRedis: Boolean(process.env.REDIS_SENTINEL_HOSTS),
+ useRedis: Boolean(process.env.REDIS_SENTINEL_HOSTS || process.env.REDIS_HOST),
},
cache: {