diff --git a/apps/dokploy/public/templates/registry.png b/apps/dokploy/public/templates/registry.png new file mode 100644 index 00000000..39418022 Binary files /dev/null and b/apps/dokploy/public/templates/registry.png differ diff --git a/apps/dokploy/templates/registry/docker-compose.yml b/apps/dokploy/templates/registry/docker-compose.yml new file mode 100644 index 00000000..08c5c368 --- /dev/null +++ b/apps/dokploy/templates/registry/docker-compose.yml @@ -0,0 +1,19 @@ +services: + registry: + restart: always + image: registry:2 + ports: + - 5000 + volumes: + - ../files/auth/registry.password:/auth/registry.password + - registry-data:/var/lib/registry + environment: + REGISTRY_STORAGE_DELETE_ENABLED: true + REGISTRY_HEALTH_STORAGEDRIVER_ENABLED: false + REGISTRY_HTTP_SECRET: ${REGISTRY_HTTP_SECRET} + REGISTRY_AUTH: htpasswd + REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm + REGISTRY_AUTH_HTPASSWD_PATH: /auth/registry.password + +volumes: + registry-data: \ No newline at end of file diff --git a/apps/dokploy/templates/registry/index.ts b/apps/dokploy/templates/registry/index.ts new file mode 100644 index 00000000..81965e6e --- /dev/null +++ b/apps/dokploy/templates/registry/index.ts @@ -0,0 +1,35 @@ +import { + type DomainSchema, + type Schema, + type Template, + generatePassword, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + const domains: DomainSchema[] = [ + { + host: generateRandomDomain(schema), + port: 5000, + serviceName: "registry", + }, + ]; + + const registryHttpSecret = generatePassword(30); + + const envs = [`REGISTRY_HTTP_SECRET=${registryHttpSecret}`]; + + const mounts: Template["mounts"] = [ + { + filePath: "/auth/registry.password", + content: + "# from: docker run --rm --entrypoint htpasswd httpd:2 -Bbn docker password\ndocker:$2y$10$qWZoWev/u5PV7WneFoRAMuoGpRcAQOgUuIIdLnU7pJXogrBSY23/2\n", + }, + ]; + + return { + domains, + envs, + mounts, + }; +} diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 17498e03..f1900ec2 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -1439,6 +1439,21 @@ export const templates: TemplateData[] = [ tags: ["file-manager", "vdfs", "storage"], load: () => import("./spacedrive/index").then((m) => m.generate), }, + { + id: "registry", + name: "Docker Registry", + version: "2", + description: + "Distribution implementation for storing and distributing of Docker container images and artifacts.", + links: { + github: "https://github.com/distribution/distribution", + website: "https://hub.docker.com/_/registry", + docs: "https://distribution.github.io/distribution/", + }, + logo: "registry.png", + tags: ["registry", "docker", "self-hosted"], + load: () => import("./registry/index").then((m) => m.generate), + }, { id: "alist", name: "AList",