From 53b24534a8da942699aa4975d74303714773151a Mon Sep 17 00:00:00 2001 From: Freilynbp03 Date: Wed, 21 Aug 2024 21:45:14 -0400 Subject: [PATCH] feat(template): add Aptabase template with ClickHouse and PostgreSQL --- .../templates/aptabase/docker-compose.yml | 18 ++++++++++++++++-- apps/dokploy/templates/aptabase/index.ts | 8 ++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/apps/dokploy/templates/aptabase/docker-compose.yml b/apps/dokploy/templates/aptabase/docker-compose.yml index 057aec9d7..357c99d07 100644 --- a/apps/dokploy/templates/aptabase/docker-compose.yml +++ b/apps/dokploy/templates/aptabase/docker-compose.yml @@ -8,6 +8,13 @@ services: environment: POSTGRES_USER: aptabase POSTGRES_PASSWORD: sTr0NGp4ssw0rd + networks: + - dokploy-network + healthcheck: + test: ["CMD-SHELL", "pg_isready -U aptabase"] + interval: 10s + timeout: 5s + retries: 5 aptabase_events_db: container_name: aptabase_events_db @@ -22,6 +29,13 @@ services: nofile: soft: 262144 hard: 262144 + networks: + - dokploy-network + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:8123 || exit 1"] + interval: 10s + timeout: 5s + retries: 5 aptabase: container_name: aptabase_app @@ -33,8 +47,8 @@ services: ports: - 8000:8080 environment: - BASE_URL: http://localhost:8000 # replace with your ip or domain, including port if needed - AUTH_SECRET: c4rI4x8kz5DgKJ1is5Eiu9bNncSQ6ROD # get a strong secret from https://randomkeygen.com/ + BASE_URL: http://${APTABASE_HOST} + AUTH_SECRET: ${AUTH_SECRET} DATABASE_URL: Server=aptabase_db;Port=5432;User Id=aptabase;Password=sTr0NGp4ssw0rd;Database=aptabase CLICKHOUSE_URL: Host=aptabase_events_db;Port=8123;Username=aptabase;Password=sTr0NGp4ssw0rd diff --git a/apps/dokploy/templates/aptabase/index.ts b/apps/dokploy/templates/aptabase/index.ts index 6a6cb527b..8d793d68e 100644 --- a/apps/dokploy/templates/aptabase/index.ts +++ b/apps/dokploy/templates/aptabase/index.ts @@ -21,12 +21,8 @@ export function generate(schema: Schema): Template { ]; const envs = [ - `BASE_URL=http://${mainDomain}`, - `AUTH_SECRET=${authSecret}`, - `POSTGRES_PASSWORD=${postgresPassword}`, - `CLICKHOUSE_PASSWORD=${clickhousePassword}`, - `DATABASE_URL=Server=aptabase_db;Port=5432;User Id=aptabase;Password=${postgresPassword};Database=aptabase`, - `CLICKHOUSE_URL=Host=aptabase_events_db;Port=8123;Username=aptabase;Password=${clickhousePassword}`, + `APTABASE_HOST=${mainDomain}`, + `AUTH_SECRET=${authSecret}` ]; return {