From fd570ff861e6e76b6053148234606b6b2a005f5b Mon Sep 17 00:00:00 2001 From: Freilyn Bernabe Date: Thu, 23 Jan 2025 23:41:58 -0400 Subject: [PATCH 1/2] feat(template): added maybe finance --- apps/dokploy/public/templates/maybe.svg | 17 ++++++++ .../templates/maybe/docker-compose.yml | 37 ++++++++++++++++ apps/dokploy/templates/maybe/index.ts | 43 +++++++++++++++++++ apps/dokploy/templates/templates.ts | 15 +++++++ 4 files changed, 112 insertions(+) create mode 100644 apps/dokploy/public/templates/maybe.svg create mode 100644 apps/dokploy/templates/maybe/docker-compose.yml create mode 100644 apps/dokploy/templates/maybe/index.ts diff --git a/apps/dokploy/public/templates/maybe.svg b/apps/dokploy/public/templates/maybe.svg new file mode 100644 index 00000000..a4a87736 --- /dev/null +++ b/apps/dokploy/public/templates/maybe.svg @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/apps/dokploy/templates/maybe/docker-compose.yml b/apps/dokploy/templates/maybe/docker-compose.yml new file mode 100644 index 00000000..84ec297e --- /dev/null +++ b/apps/dokploy/templates/maybe/docker-compose.yml @@ -0,0 +1,37 @@ +services: + app: + image: ghcr.io/maybe-finance/maybe:sha-68c570eed8810fd59b5b33cca51bbad5eabb4cb4 + restart: unless-stopped + volumes: + - ./uploads:/app/uploads + environment: + DATABASE_URL: postgresql://maybe:maybe@db:5432/maybe + SECRET_KEY_BASE: ${SECRET_KEY_BASE} + SELF_HOSTED: true + SYNTH_API_KEY: ${SYNTH_API_KEY} + RAILS_FORCE_SSL: "false" + RAILS_ASSUME_SSL: "false" + GOOD_JOB_EXECUTION_MODE: async + depends_on: + db: + condition: service_healthy + + db: + image: postgres:16 + restart: always + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] + interval: 5s + timeout: 5s + retries: 5 + networks: + - dokploy-network + volumes: + - db-data:/var/lib/postgresql/data + environment: + POSTGRES_DB: maybe + POSTGRES_USER: maybe + POSTGRES_PASSWORD: maybe + +volumes: + db-data: diff --git a/apps/dokploy/templates/maybe/index.ts b/apps/dokploy/templates/maybe/index.ts new file mode 100644 index 00000000..5eaf7a81 --- /dev/null +++ b/apps/dokploy/templates/maybe/index.ts @@ -0,0 +1,43 @@ +import { + type DomainSchema, + type Schema, + type Template, + generateBase64, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + const mainDomain = generateRandomDomain(schema); + const secretKeyBase = generateBase64(64); + const synthApiKey = generateBase64(32); + + const domains: DomainSchema[] = [ + { + host: mainDomain, + port: 3000, + serviceName: "app", + }, + ]; + + const envs = [ + `SECRET_KEY_BASE=${secretKeyBase}`, + "SELF_HOSTED=true", + `SYNTH_API_KEY=${synthApiKey}`, + "RAILS_FORCE_SSL=false", + "RAILS_ASSUME_SSL=false", + "GOOD_JOB_EXECUTION_MODE=async", + ]; + + const mounts: Template["mounts"] = [ + { + filePath: "./uploads", + content: "This is where user uploads will be stored", + }, + ]; + + return { + envs, + mounts, + domains, + }; +} diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 1bdb1ec1..8291eb66 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -1341,4 +1341,19 @@ export const templates: TemplateData[] = [ tags: ["dashboard", "monitoring"], load: () => import("./homarr/index").then((m) => m.generate), }, + { + id: "maybe", + name: "Maybe", + version: "latest", + description: + "Maybe is a self-hosted finance tracking application designed to simplify budgeting and expenses.", + logo: "maybe.svg", + links: { + github: "https://github.com/maybe-finance/maybe", + website: "https://maybe.finance/", + docs: "https://docs.maybe.finance/", + }, + tags: ["finance", "self-hosted"], + load: () => import("./maybe/index").then((m) => m.generate), + }, ]; From 87697147da35dac31682b7fe6c1241deec0990c9 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 26 Jan 2025 14:29:51 -0600 Subject: [PATCH 2/2] Update apps/dokploy/templates/maybe/docker-compose.yml --- apps/dokploy/templates/maybe/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dokploy/templates/maybe/docker-compose.yml b/apps/dokploy/templates/maybe/docker-compose.yml index 84ec297e..017ca29b 100644 --- a/apps/dokploy/templates/maybe/docker-compose.yml +++ b/apps/dokploy/templates/maybe/docker-compose.yml @@ -3,7 +3,7 @@ services: image: ghcr.io/maybe-finance/maybe:sha-68c570eed8810fd59b5b33cca51bbad5eabb4cb4 restart: unless-stopped volumes: - - ./uploads:/app/uploads + - ../files/uploads:/app/uploads environment: DATABASE_URL: postgresql://maybe:maybe@db:5432/maybe SECRET_KEY_BASE: ${SECRET_KEY_BASE}