feat: add unifi template

This commit is contained in:
Mauricio Siu
2024-12-29 17:19:17 -06:00
parent e93e15a9c8
commit 1d02d4308f
4 changed files with 90 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -1151,4 +1151,19 @@ export const templates: TemplateData[] = [
tags: ["self-hosted", "development"],
load: () => import("./onedev/index").then((m) => m.generate),
},
{
id: "unifi",
name: "Unifi Network",
version: "11.6.6",
description:
"Unifi Network is an open-source enterprise network management platform for wireless networks.",
logo: "unifi.webp",
links: {
github: "https://github.com/ubiquiti",
website: "https://www.ui.com/",
docs: "https://help.ui.com/hc/en-us/articles/360012282453-Self-Hosting-a-UniFi-Network-Server",
},
tags: ["self-hosted", "networking"],
load: () => import("./unifi/index").then((m) => m.generate),
},
];

View File

@@ -0,0 +1,48 @@
services:
unifi-network-application:
image: lscr.io/linuxserver/unifi-network-application:latest
environment:
- PUID=1000 # User ID
- PGID=1000 # Group ID
- TZ=Etc/UTC # Timezone
- MONGO_HOST=unifi-db
- MONGO_USER=unifi
- MONGO_PASS=unifi_password
- MONGO_PORT=27017
- MONGO_DBNAME=unifi
- MEM_LIMIT=1024
- MEM_STARTUP=1024
- MONGO_TLS= #optional # MongoDB TLS setting
- MONGO_AUTHSOURCE= #optional # MongoDB authentication source
volumes: # Volumes to mount in the container
- ../files/config:/config # Map host directory to container directory
ports:
- 8443:8443 # HTTPS portal
# - 3478:3478/udp # STUN service
# - 10001:10001/udp # UniFi AP discovery
# - 8080:8080 # HTTP portal
# - 1900:1900/udp #optional # For DLNA
# - 8843:8843 #optional # HTTPS guest portal
# - 8880:8880 #optional # HTTP guest portal
# - 6789:6789 #optional # Mobile speed test port
# - 5514:5514/udp #optional # Remote syslog port
restart: unless-stopped
depends_on:
- unifi-db
networks:
- dokploy-network
unifi-db:
image: mongo:4.4
volumes:
- ../files/db/data:/data/db
- ../files/init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh:ro
ports:
- 27017
restart: unless-stopped
networks:
- dokploy-network
networks:
dokploy-network:
external: true

View File

@@ -0,0 +1,27 @@
import type { Schema, Template } from "../utils";
export function generate(schema: Schema): Template {
const mounts: Template["mounts"] = [
{
filePath: "init-mongo.sh",
content: `
#!/bin/bash
mongo <<EOF
use unifi
db.createUser({
user: "unifi",
pwd: "unifi_password",
roles: [
{ db: "unifi", role: "dbOwner" },
{ db: "unifi_stat", role: "dbOwner" }
]
})
EOF
`,
},
];
return {
mounts,
};
}