diff --git a/package.json b/package.json index 6745af92..81666586 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "dokploy", "version": "v0.2.5", "private": true, - "license": "AGPL-3.0-only", + "license": "Apache-2.0", "type": "module", "scripts": { "build": "npm run build-server && npm run build-next", @@ -19,7 +19,7 @@ "migration:drop": "drizzle-kit drop --config ./server/db/drizzle.config.ts", "db:push": "drizzle-kit --config ./server/db/drizzle.config.ts", "db:truncate": "tsx -r dotenv/config ./server/db/reset.ts", - "db:studio": "drizzle-kit studio", + "db:studio": "drizzle-kit studio --config ./server/db/drizzle.config.ts", "lint": "biome lint", "db:seed": "tsx -r dotenv/config ./server/db/seed.ts", "db:clean": "tsx -r dotenv/config ./server/db/reset.ts", diff --git a/public/templates/meilisearch.png b/public/templates/meilisearch.png new file mode 100644 index 00000000..7bbb458f Binary files /dev/null and b/public/templates/meilisearch.png differ diff --git a/public/templates/phpmyadmin.png b/public/templates/phpmyadmin.png new file mode 100644 index 00000000..56e18d85 Binary files /dev/null and b/public/templates/phpmyadmin.png differ diff --git a/public/templates/rocketchat.png b/public/templates/rocketchat.png new file mode 100644 index 00000000..5d42c70f Binary files /dev/null and b/public/templates/rocketchat.png differ diff --git a/templates/meilisearch/docker-compose.yml b/templates/meilisearch/docker-compose.yml new file mode 100644 index 00000000..3ce8f212 --- /dev/null +++ b/templates/meilisearch/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3.8' + +services: + meilisearch: + networks: + - dokploy-network + image: getmeili/meilisearch:v1.8.3 + ports: + - ${MEILISEARCH_PORT} + volumes: + - meili_data:/meili_data + environment: + MEILI_MASTER_KEY: ${MEILI_MASTER_KEY} + MEILI_ENV: ${MEILI_ENV} + labels: + - traefik.enable=true + - traefik.http.routers.${HASH}.rule=Host(`${MEILISEARCH_HOST}`) + - traefik.http.services.${HASH}.loadbalancer.server.port=${MEILISEARCH_PORT} + +volumes: + meili_data: + driver: local +networks: + dokploy-network: + external: true diff --git a/templates/meilisearch/index.ts b/templates/meilisearch/index.ts new file mode 100644 index 00000000..84fca4db --- /dev/null +++ b/templates/meilisearch/index.ts @@ -0,0 +1,24 @@ +import { + generateHash, + generateRandomDomain, + type Template, + type Schema, + generateBase64, +} from "../utils"; + +export function generate(schema: Schema): Template { + const mainServiceHash = generateHash(schema.projectName); + const randomDomain = generateRandomDomain(schema); + const masterKey = generateBase64(32); + const envs = [ + `MEILISEARCH_HOST=${randomDomain}`, + "MEILISEARCH_PORT=7700", + "MEILI_ENV=development", + `MEILI_MASTER_KEY=${masterKey}`, + `HASH=${mainServiceHash}`, + ]; + + return { + envs, + }; +} diff --git a/templates/phpmyadmin/docker-compose.yml b/templates/phpmyadmin/docker-compose.yml new file mode 100644 index 00000000..c6743a58 --- /dev/null +++ b/templates/phpmyadmin/docker-compose.yml @@ -0,0 +1,40 @@ +version: '3.8' + +services: + db: + image: mysql:5.7 + environment: + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} + MYSQL_DATABASE: tu_base_de_datos + MYSQL_USER: ${MYSQL_USER} + MYSQL_PASSWORD: ${MYSQL_PASSWORD} + volumes: + - db_data:/var/lib/mysql + networks: + - dokploy-network + + phpmyadmin: + image: phpmyadmin/phpmyadmin:5.2.1 + environment: + PMA_HOST: db + PMA_USER: ${MYSQL_USER} + PMA_PASSWORD: ${MYSQL_PASSWORD} + PMA_ARBITRARY: 1 + ports: + - ${PHPMYADMIN_PORT} + depends_on: + - db + labels: + - traefik.enable=true + - traefik.http.routers.${HASH}.rule=Host(`${PHPMYADMIN_HOST}`) + - traefik.http.services.${HASH}.loadbalancer.server.port=${PHPMYADMIN_PORT} + networks: + - dokploy-network + +volumes: + db_data: + driver: local + +networks: + dokploy-network: + external: true diff --git a/templates/phpmyadmin/index.ts b/templates/phpmyadmin/index.ts new file mode 100644 index 00000000..24e546ce --- /dev/null +++ b/templates/phpmyadmin/index.ts @@ -0,0 +1,27 @@ +import { + generateHash, + generateRandomDomain, + type Template, + type Schema, + generatePassword, +} from "../utils"; + +export function generate(schema: Schema): Template { + const mainServiceHash = generateHash(schema.projectName); + const randomDomain = generateRandomDomain(schema); + const rootPassword = generatePassword(32); + const password = generatePassword(32); + const envs = [ + `PHPMYADMIN_HOST=${randomDomain}`, + "PHPMYADMIN_PORT=80", + `HASH=${mainServiceHash}`, + `MYSQL_ROOT_PASSWORD=${rootPassword}`, + "MYSQL_DATABASE=mysql", + "MYSQL_USER=phpmyadmin", + `MYSQL_PASSWORD=${password}`, + ]; + + return { + envs, + }; +} diff --git a/templates/pocketbase/index.ts b/templates/pocketbase/index.ts index a38ec312..11eb62b3 100644 --- a/templates/pocketbase/index.ts +++ b/templates/pocketbase/index.ts @@ -5,7 +5,6 @@ import { type Schema, } from "../utils"; -// https://pocketbase.io/docs/ export function generate(schema: Schema): Template { const mainServiceHash = generateHash(schema.projectName); const randomDomain = generateRandomDomain(schema); diff --git a/templates/rocketchat/docker-compose.yml b/templates/rocketchat/docker-compose.yml new file mode 100644 index 00000000..78056b9a --- /dev/null +++ b/templates/rocketchat/docker-compose.yml @@ -0,0 +1,48 @@ +version: "3.8" +services: + rocketchat: + image: registry.rocket.chat/rocketchat/rocket.chat:6.9.2 + restart: always + environment: + MONGO_URL: "mongodb://mongodb:27017/rocketchat?replicaSet=rs0" + MONGO_OPLOG_URL: "mongodb://mongodb:27017/local?replicaSet=rs0" + ROOT_URL: ${ROOT_URL:-http://${ROCKETCHAT_HOST}:${ROCKETCHAT_PORT}} + PORT: ${ROCKETCHAT_PORT} + DEPLOY_METHOD: docker + DEPLOY_PLATFORM: + REG_TOKEN: + depends_on: + - mongodb + ports: + - ${ROCKETCHAT_PORT} + networks: + - dokploy-network + labels: + - traefik.enable=true + - traefik.http.routers.${HASH}.rule=Host(`${ROCKETCHAT_HOST}`) + - traefik.http.services.${HASH}.loadbalancer.server.port=${ROCKETCHAT_PORT} + + mongodb: + image: docker.io/bitnami/mongodb:5.0 + restart: always + volumes: + - mongodb_data:/bitnami/mongodb + environment: + MONGODB_REPLICA_SET_MODE: primary + MONGODB_REPLICA_SET_NAME: rs0 + MONGODB_PORT_NUMBER: 27017 + MONGODB_INITIAL_PRIMARY_HOST: mongodb + MONGODB_INITIAL_PRIMARY_PORT_NUMBER: 27017 + MONGODB_ADVERTISED_HOSTNAME: mongodb + MONGODB_ENABLE_JOURNAL: true + ALLOW_EMPTY_PASSWORD: yes + networks: + - dokploy-network + +volumes: + mongodb_data: { driver: local } + + +networks: + dokploy-network: + external: true \ No newline at end of file diff --git a/templates/rocketchat/index.ts b/templates/rocketchat/index.ts new file mode 100644 index 00000000..4946864c --- /dev/null +++ b/templates/rocketchat/index.ts @@ -0,0 +1,21 @@ +import { + generateHash, + generateRandomDomain, + type Template, + type Schema, +} from "../utils"; + +export function generate(schema: Schema): Template { + const mainServiceHash = generateHash(schema.projectName); + const randomDomain = generateRandomDomain(schema); + + const envs = [ + `ROCKETCHAT_HOST=${randomDomain}`, + "ROCKETCHAT_PORT=3000", + `HASH=${mainServiceHash}`, + ]; + + return { + envs, + }; +} diff --git a/templates/templates.ts b/templates/templates.ts index c79ea559..e94bf994 100644 --- a/templates/templates.ts +++ b/templates/templates.ts @@ -229,4 +229,49 @@ export const templates: TemplateData[] = [ tags: ["database", "spreadsheet", "low-code", "nocode"], load: () => import("./nocodb/index").then((m) => m.generate), }, + { + id: "meilisearch", + name: "Meilisearch", + version: "v1.8.3", + description: + "Meilisearch is a free and open-source search engine that allows you to easily add search functionality to your web applications.", + logo: "meilisearch.png", + links: { + github: "https://github.com/meilisearch/meilisearch", + website: "https://www.meilisearch.com/", + docs: "https://docs.meilisearch.com/", + }, + tags: ["search"], + load: () => import("./meilisearch/index").then((m) => m.generate), + }, + { + id: "phpmyadmin", + name: "Phpmyadmin", + version: "5.2.1", + description: + "Phpmyadmin is a free and open-source web interface for MySQL and MariaDB that allows you to manage your databases.", + logo: "phpmyadmin.png", + links: { + github: "https://github.com/phpmyadmin/phpmyadmin", + website: "https://www.phpmyadmin.net/", + docs: "https://www.phpmyadmin.net/docs/", + }, + tags: ["database"], + load: () => import("./phpmyadmin/index").then((m) => m.generate), + }, + { + id: "rocketchat", + name: "Rocketchat", + version: "6.9.2", + description: + "Rocket.Chat is a free and open-source web chat platform that allows you to build and manage your own chat applications.", + logo: "rocketchat.png", + links: { + github: "https://github.com/RocketChat/Rocket.Chat", + website: "https://rocket.chat/", + docs: "https://rocket.chat/docs/", + }, + tags: ["chat"], + load: () => import("./rocketchat/index").then((m) => m.generate), + }, ];