diff --git a/apps/dokploy/public/templates/kimai.svg b/apps/dokploy/public/templates/kimai.svg new file mode 100644 index 00000000..8b2a6c1e --- /dev/null +++ b/apps/dokploy/public/templates/kimai.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/dokploy/templates/kimai/docker-compose.yml b/apps/dokploy/templates/kimai/docker-compose.yml new file mode 100644 index 00000000..6a04b3b9 --- /dev/null +++ b/apps/dokploy/templates/kimai/docker-compose.yml @@ -0,0 +1,51 @@ +services: + app: + image: kimai/kimai2:apache-2.26.0 + restart: unless-stopped + environment: + APP_ENV: prod + DATABASE_URL: mysql://kimai:${KI_MYSQL_PASSWORD:-kimai}@db/kimai + TRUSTED_PROXIES: localhost + APP_SECRET: ${KI_APP_SECRET} + MAILER_FROM: ${KI_MAILER_FROM:-admin@kimai.local} + MAILER_URL: ${KI_MAILER_URL:-null://null} + ADMINMAIL: ${KI_ADMINMAIL:-admin@kimai.local} + ADMINPASS: ${KI_ADMINPASS} + volumes: + - kimai-data:/opt/kimai/var + depends_on: + db: + condition: service_healthy + networks: + - dokploy-network + db: + image: mariadb:10.11 + restart: unless-stopped + environment: + - MYSQL_DATABASE=kimai + - MYSQL_USER=kimai + - MYSQL_PASSWORD=${KI_MYSQL_PASSWORD} + - MYSQL_ROOT_PASSWORD=${KI_MYSQL_ROOT_PASSWORD} + volumes: + - mysql-data:/var/lib/mysql + command: + - --character-set-server=utf8mb4 + - --collation-server=utf8mb4_unicode_ci + - --innodb-buffer-pool-size=256M + - --innodb-flush-log-at-trx-commit=2 + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "kimai", "-p${KI_MYSQL_PASSWORD}"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s + networks: + - dokploy-network + +networks: + dokploy-network: + external: true + +volumes: + kimai-data: + mysql-data: \ No newline at end of file diff --git a/apps/dokploy/templates/kimai/index.ts b/apps/dokploy/templates/kimai/index.ts new file mode 100644 index 00000000..5569905e --- /dev/null +++ b/apps/dokploy/templates/kimai/index.ts @@ -0,0 +1,37 @@ +import { + type DomainSchema, + type Schema, + type Template, + generatePassword, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + const domain = generateRandomDomain(schema); + const domains: DomainSchema[] = [ + { + host: domain, + port: 8001, + serviceName: "app", + }, + ]; + + const adminPassword = generatePassword(32); + const mysqlPassword = generatePassword(32); + const mysqlRootPassword = generatePassword(32); + const appSecret = generatePassword(32); + + const envs = [ + `KI_HOST=${domain}`, + "KI_ADMINMAIL=admin@kimai.local", + `KI_ADMINPASS=${adminPassword}`, + `KI_MYSQL_ROOT_PASSWORD=${mysqlRootPassword}`, + `KI_MYSQL_PASSWORD=${mysqlPassword}`, + `KI_APP_SECRET=${appSecret}`, + ]; + + return { + envs, + domains, + }; +} diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index ef418d2b..e1834467 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -987,4 +987,19 @@ export const templates: TemplateData[] = [ tags: ["event-driven", "applications"], load: () => import("./triggerdotdev/index").then((m) => m.generate), }, + { + id: "kimai", + name: "Kimai", + version: "2.26.0", + description: + "Kimai is a web-based multi-user time-tracking application. Works great for everyone: freelancers, companies, organizations - everyone can track their times, generate reports, create invoices and do so much more.", + logo: "kimai.svg", + links: { + github: "https://github.com/kimai/kimai", + website: "https://www.kimai.org", + docs: "https://www.kimai.org/documentation", + }, + tags: ["invoice", "business", "finance"], + load: () => import("./kimai/index").then((m) => m.generate), + }, ];