diff --git a/public/templates/nocodb.png b/public/templates/nocodb.png new file mode 100644 index 00000000..70af4926 Binary files /dev/null and b/public/templates/nocodb.png differ diff --git a/templates/nocodb/docker-compose.yml b/templates/nocodb/docker-compose.yml new file mode 100644 index 00000000..fdb71f7b --- /dev/null +++ b/templates/nocodb/docker-compose.yml @@ -0,0 +1,44 @@ +version: "3.8" +services: + nocodb: + image: nocodb/nocodb:latest + restart: always + networks: + - dokploy-network + ports: + - ${NOCODB_PORT} + environment: + NC_DB : "pg://root_db?u=postgres&p=password&d=root_db" + PORT : ${NOCODB_PORT} + NC_REDIS_URL: ${NC_REDIS_URL} + labels: + - traefik.enable=true + - traefik.http.routers.${HASH}.rule=Host(`${NOCODB_HOST}`) + - traefik.http.services.${HASH}.loadbalancer.server.port=${NOCODB_PORT} + volumes: + - nc_data:/usr/app/data + + root_db: + image: postgres + restart: always + networks: + - dokploy-network + environment: + POSTGRES_DB: root_db + POSTGRES_PASSWORD: password + POSTGRES_USER: postgres + healthcheck: + interval: 10s + retries: 10 + test: "pg_isready -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\"" + timeout: 2s + volumes: + - "db_data:/var/lib/postgresql/data" + +networks: + dokploy-network: + external: true + +volumes: + db_data: {} + nc_data: {} \ No newline at end of file diff --git a/templates/nocodb/index.ts b/templates/nocodb/index.ts new file mode 100644 index 00000000..b41aced0 --- /dev/null +++ b/templates/nocodb/index.ts @@ -0,0 +1,28 @@ +// EXAMPLE +import { + generateHash, + generateRandomDomain, + generateBase64, + type Template, + type Schema, +} from "../utils"; + + +export function generate(schema: Schema): Template { + + const mainServiceHash = generateHash(schema.projectName); + const randomDomain = generateRandomDomain(schema); + const secretBase = generateBase64(64); + const toptKeyBase = generateBase64(32); + + const envs = [ + `NOCODB_HOST=${randomDomain}`, + "NOCODB_PORT=8000", + `NC_AUTH_JWT_SECRET=${secretBase}`, + `HASH=${mainServiceHash}`, + ]; + + return { + envs, + }; +} \ No newline at end of file diff --git a/templates/templates.ts b/templates/templates.ts index 6db09f0d..83833656 100644 --- a/templates/templates.ts +++ b/templates/templates.ts @@ -63,4 +63,20 @@ export const templates: TemplateData[] = [ tags: ["document-signing"], load: () => import("./documenso/index").then((m) => m.generate), }, + { + id: "nocodb", + name: "NocoDB", + version: "0.250.2", + description: + "NocoDB is an opensource Airtable alternative that turns any MySQL, PostgreSQL, SQL Server, SQLite & MariaDB into a smart spreadsheet.", + + links: { + github: "https://github.com/nocodb/nocodb", + website: "https://nocodb.com/", + docs: "https://docs.nocodb.com/", + }, + logo: "nocodb.png", + tags: ["database", "spreadsheet", "low-code", 'nocode'], + load: () => import("./nocodb/index").then((m) => m.generate), + }, ];