Fix Dokploy database and CORS config
This commit is contained in:
@@ -133,7 +133,7 @@ client address.
|
||||
|
||||
## Dokploy
|
||||
|
||||
Use `docker-compose.dev.yml` as the Dokploy compose path for a self-contained
|
||||
Use `docker-compose.prod.yml` as the Dokploy compose path for a self-contained
|
||||
backend deployment with MySQL and a local SMTP catcher. Configure the public
|
||||
domain in Dokploy against service `backend` and container port `5555`.
|
||||
|
||||
@@ -142,8 +142,10 @@ with Dokploy environment variables. The SMTP catcher service keeps the internal
|
||||
name `mailhog` for compatibility, but uses the multi-architecture Mailpit image
|
||||
to avoid `exec format error` failures on ARM servers.
|
||||
|
||||
Set `MYSQL_PASSWORD`, `MYSQL_ROOT_PASSWORD` and any other environment-specific
|
||||
values in Dokploy environment variables.
|
||||
Set `DB_NAME`, `DB_USER`, `DB_PASSWORD`, `MYSQL_ROOT_PASSWORD` and
|
||||
`CORS_ALLOWED_ORIGIN` in Dokploy environment variables. Use the exact browser
|
||||
origin without quotes or a trailing slash, for example
|
||||
`https://visione.studentindipendenti.it`.
|
||||
|
||||
## Current Endpoints
|
||||
|
||||
|
||||
@@ -9,12 +9,13 @@ services:
|
||||
environment:
|
||||
DB_HOST: ${DB_HOST:-mysql}
|
||||
DB_PORT: ${DB_PORT:-3306}
|
||||
DB_USER: ${MYSQL_USER:-visione}
|
||||
DB_PASSWORD: ${MYSQL_PASSWORD:-visione}
|
||||
DB_NAME: ${MYSQL_DATABASE:-visione}
|
||||
DB_USER: ${DB_USER:-visione}
|
||||
DB_PASSWORD: ${DB_PASSWORD:-visione}
|
||||
DB_NAME: ${DB_NAME:-visione}
|
||||
DB_TIMEOUT: ${DB_TIMEOUT:-30}
|
||||
SMTP_HOST: ${SMTP_HOST:-mailhog}
|
||||
SMTP_PORT: ${SMTP_PORT:-1025}
|
||||
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-http://localhost:3000}
|
||||
CORS_ALLOWED_ORIGIN: ${CORS_ALLOWED_ORIGIN:-http://localhost:3000}
|
||||
expose:
|
||||
- "5555"
|
||||
networks:
|
||||
@@ -29,9 +30,9 @@ services:
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD:-root}"
|
||||
MYSQL_DATABASE: "${MYSQL_DATABASE:-visione}"
|
||||
MYSQL_USER: "${MYSQL_USER:-visione}"
|
||||
MYSQL_PASSWORD: "${MYSQL_PASSWORD:-visione}"
|
||||
MYSQL_DATABASE: "${DB_NAME:-visione}"
|
||||
MYSQL_USER: "${DB_USER:-visione}"
|
||||
MYSQL_PASSWORD: "${DB_PASSWORD:-visione}"
|
||||
expose:
|
||||
- "3306"
|
||||
volumes:
|
||||
|
||||
@@ -29,7 +29,9 @@ int main()
|
||||
config["db_clients"][0]["passwd"] = envPass;
|
||||
if (const char* envDb = std::getenv("DB_NAME"))
|
||||
config["db_clients"][0]["dbname"] = envDb;
|
||||
|
||||
if (const char* envTimeout = std::getenv("DB_TIMEOUT"))
|
||||
config["db_clients"][0]["timeout"] = std::stod(envTimeout);
|
||||
|
||||
if (const char* envSmtpHost = std::getenv("SMTP_HOST"))
|
||||
config["custom_config"]["mail"]["smtp_host"] = envSmtpHost;
|
||||
if (const char* envSmtpPort = std::getenv("SMTP_PORT"))
|
||||
|
||||
Reference in New Issue
Block a user