diff --git a/public/templates/wordpress.png b/public/templates/wordpress.png new file mode 100644 index 00000000..693cb902 Binary files /dev/null and b/public/templates/wordpress.png differ diff --git a/templates/templates.ts b/templates/templates.ts index fd01176d..05215395 100644 --- a/templates/templates.ts +++ b/templates/templates.ts @@ -137,4 +137,19 @@ export const templates: TemplateData[] = [ tags: ["automation"], load: () => import("./n8n/index").then((m) => m.generate), }, + { + id: "wordpress", + name: "Wordpress", + version: "5.8.3", + description: + "Wordpress is a free and open source content management system (CMS) for publishing and managing websites.", + logo: "wordpress.png", + links: { + github: "https://github.com/WordPress/WordPress", + website: "https://wordpress.org/", + docs: "https://wordpress.org/documentation/", + }, + tags: ["cms"], + load: () => import("./wordpress/index").then((m) => m.generate), + }, ]; diff --git a/templates/wordpress/docker-compose.yml b/templates/wordpress/docker-compose.yml new file mode 100644 index 00000000..4e2fb64c --- /dev/null +++ b/templates/wordpress/docker-compose.yml @@ -0,0 +1,40 @@ +version: '3.8' + +services: + wordpress: + image: wordpress:5.8.3 + networks: + - dokploy-network + ports: + - ${WORDPRESS_PORT} + environment: + WORDPRESS_DB_HOST: db + WORDPRESS_DB_USER: exampleuser + WORDPRESS_DB_PASSWORD: examplepass + WORDPRESS_DB_NAME: exampledb + labels: + - "traefik.enable=true" + - "traefik.http.routers.${HASH}.rule=Host(`${WORDPRESS_HOST}`)" + - "traefik.http.services.${HASH}.loadbalancer.server.port=${WORDPRESS_PORT}" + volumes: + - wordpress_data:/var/www/html + + db: + image: mysql:5.7.34 + networks: + - dokploy-network + environment: + MYSQL_DATABASE: exampledb + MYSQL_USER: exampleuser + MYSQL_PASSWORD: examplepass + MYSQL_ROOT_PASSWORD: rootpass + volumes: + - db_data:/var/lib/mysql + +volumes: + wordpress_data: + db_data: + +networks: + dokploy-network: + external: true diff --git a/templates/wordpress/index.ts b/templates/wordpress/index.ts new file mode 100644 index 00000000..8fb62e1e --- /dev/null +++ b/templates/wordpress/index.ts @@ -0,0 +1,20 @@ +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 = [ + `WORDPRESS_HOST=${randomDomain}`, + "WORDPRESS_PORT=80", + `HASH=${mainServiceHash}`, + ]; + + return { + envs, + }; +}