Skip to content

Commit 53c2ddb

Browse files
SiumauriciotknsunilRabithuaMauricio Siuscanash00
authored
New Templates (#586)
* feat(librechat): add LibreChat blueprint with compose, toml, metadata, links and tags * fix: rename templates to template.toml * fix(librechat): rename api service to librechat in docker-compose.yml * Update blueprints/librechat/template.toml * Update blueprints/librechat/template.toml * fix(librechat): add version under [config] and remove stray [config.mounts] header * fix(librechat): remove predefined persistent volume mounts from template.toml * docs(librechat): add authentication reference link to docker-compose.yml * feat: add Rote template - Add Rote deployment template with frontend, backend, and PostgreSQL services - Configure domain routing for frontend (port 80) and backend (port 3000) - Set up automatic password generation and environment variables - Use latest image tag by default - Add logo and metadata to meta.json * fix: process meta.json to fix formatting and sorting * Update GitHub workflows to target 'canary' branch for meta validation * Update pnpm-lock.yaml to upgrade various dependencies, including '@codemirror/autocomplete', '@radix-ui/react-dialog', and React packages to their latest versions. This includes updates to '@types/react' and '@types/react-dom' for improved compatibility and performance. * Enhance GitHub workflows: add production deployment configuration and target 'canary' branch for pull requests. * Refactor GitHub workflow: comment out build preview steps for clarity and future modifications. * Remove unnecessary blank line in deploy-preview.yml for improved readability. * Refactor GitHub workflow: uncomment build preview steps for improved deployment process and clarity. * Update template.toml (#555) * Update template.toml * Update template.toml * Update template.toml * fix: change VITE_API_BASE to http:// for traefik.me compatibility * changed image from sknnr/enshrouded-dedicated-server to mornedhels/enshrouded-server for autoupdate and easier config * Add Openinary Template (#567) * feat: add Openinary template * feat: update Openinary configuration to support ALLOWED_ORIGIN and refactor domain variable * fix: correct DEFAULT_DOMAIN environment variable reference in docker-compose.yml (#562) * add rustfs template (#568) * feat: add pull request template for improved contribution guidelines * fix: update pull request template to clarify issue closing keywords * feat: add validation scripts and configuration for Docker Compose and template files - Introduced a GitHub Actions workflow to validate Docker Compose files and template.toml on pull requests. - Added helper functions for generating random values and processing variables in templates. - Implemented validation scripts for checking the structure, syntax, and best practices of Docker Compose and template files. - Created necessary TypeScript types and configuration files for the build scripts. * Add Passbolt template blueprint to Dokploy templates (#376) * feat(templates): add Passbolt blueprint for Dokploy - Add docker-compose.yml defining services for Passbolt and MariaDB - Create template.toml with configurable domain, email, and database credentials - Add meta.json with metadata, tags, and link to logo * fix(meta): sort meta.json entries * fix: passbolt template had several issues that broke deployment - env variables were using old array format, changed to new table format - mariadb healthcheck was broken (wrong command for mariadb 11) - missing volume mounts for gpg keys, jwt tokens, and database - setup instructions weren't visible to users, moved to docker-compose - email config had circular references causing warnings - tested admin user creation and confirmed working everything works now, fully tested * Update blueprints/passbolt/template.toml --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> * feat: Add Kokoro TTS FastAPI template (#353) (#403) * feat: Add Kokoro TTS FastAPI template (#353) - Add CPU-optimized docker-compose.yml with source build - Add GPU-optimized docker-compose-gpu.yml for NVIDIA support - Add comprehensive template.toml with OpenAI-compatible API docs - Add kokoro-tts.svg logo and meta.json entry - Support streaming audio, timestamps, and multi-language TTS - Resolves #353 * updated the meta.json for the build errors * removed the docker-compose-gpu.yml file * Update docker-compose.yml --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> * chore: remove package-lock.json file from the app directory * chore: update Tolgee to latest version and fix SMTP config typo (#432) * chore: update Tolgee to latest version and fix SMTP config typo * Update docker-compose.yml * Update docker-compose.yml --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> * fix: improve Docker Compose validation workflow to handle subshell issues - Converted the handling of COMPOSE_FILES from a pipe to an array to ensure error propagation in the parent shell. - Updated the loop to iterate over the array for better reliability in the validation process. * refactor: enhance Docker Compose validation workflow to improve error handling - Replaced the pipe with an array to handle directory names, ensuring that errors within the loop propagate correctly to the parent shell. - Updated the loop structure for better reliability in processing the directories. * Feat: Add parseable (#460) * Add parseable * Update docker-compose.yml * Update docker-compose.yml * Update blueprints/parseable/template.toml --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Co-authored-by: Mauricio Siu <siumauricio@icloud.com> * feat: add ChirpStack LoRaWAN Network Server template (#486) * feat: add ChirpStack LoRaWAN Network Server template Add complete ChirpStack v4 template with: - Main ChirpStack server with web UI - UDP and Basics Station gateway bridges - REST API interface - PostgreSQL database with PostGIS extensions - Redis cache - Mosquitto MQTT broker Default configuration for EU868 region with secure random credentials. Supports all LoRaWAN frequency bands globally. * fix(chirpstack): use original configurations from chirpstack-docker repo Update template.toml to use exact configuration files from the chirpstack-docker repository instead of simplified versions: - Use original chirpstack.toml with all 15 enabled regions - Use original gateway bridge configuration with documentation links - Use complete Basics Station EU868 config with frequency plans - Keep original Mosquitto and PostgreSQL initialization scripts Template size increased from 131 to 219 lines (4.7KB) to include comprehensive default configurations that match the official setup. * feat: add all 38 region configuration files * fix(chirpstack): add volume mounts to expose config files to containers * fix(chirpstack): remove read-only flag * fix(chirpstack): correct file paths for configuration mounts in docker-compose and template files * fix: update volume paths to be on correct directory level * fix: configure template for dokploy-network with proper DNS resolution - Add dokploy-network configuration to docker-compose.yml - Replace environment variable placeholders with actual service hostnames - Change PostgreSQL DSN from $POSTGRESQL_HOST to postgres - Change Redis server from $REDIS_HOST to redis - Replace $MQTT_BROKER_HOST with mosquitto in all 39 region configurations These changes ensure Docker DNS resolution works correctly by: - Using dokploy-network (overlay) instead of bridge network - Using service names directly in TOML config files (TOML doesn't expand env vars) - Enabling proper service discovery between containers This resolves DNS resolution failures that caused ChirpStack to fail connecting to PostgreSQL and MQTT services during deployment. * fix: add missing network configurations for all services in docker-compose * feat: add internal services to config.domains for proper network configuration * Update docker-compose.yml * fix: enhance domain validation in template validator - Updated the TemplateValidator to ensure that if the 'host' field is provided, it must be a valid string. - Added comments to clarify that 'host' is optional for internal services. * refactor: remove redundant host validation in template validator - Removed the validation for the 'host' field in the TemplateValidator, as it is optional for internal services and does not require a type check if not provided. * refactor: remove internal service domain configurations from template - Eliminated the domain configurations for internal services (Postgres, Redis, Mosquitto) from the template.toml file, streamlining the configuration for better clarity and maintainability. --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Co-authored-by: Mauricio Siu <siumauricio@icloud.com> * Update section title from 'Suggestions' to 'Requirements' * Feat : Add MCSManager template support (#521) (#522) * feat: Add MCSManager template support (#521) * Update docker-compose.yml --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> * feat: Add MediaCMS template (#524) * Feat : Add Quant-Ux template -#173 (#525) * Feat : Add Quant-Ux template -#173 * Remove extra newline in docker-compose.yml * Update blueprints/quant-ux/docker-compose.yml * Update blueprints/quant-ux/docker-compose.yml * Update blueprints/quant-ux/docker-compose.yml * Update blueprints/quant-ux/docker-compose.yml --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> * fix(rustdesk): use explicit ports, use port 21118 on hbbs instead of hbbr (#526) * fix: use explicit ports, use port 21118 on hbbs instead of hbbr * fix: whitespace character in rustdesk * feat: Add anytype template (#527) * add anytype template * sort * Update name field for Anytype in meta.json * Update meta.json * Update docker-compose.yml * Update blueprints/anytype/docker-compose.yml --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> * refactor: remove dokploy-network configurations from multiple docker-compose files - Removed the external dokploy-network configuration from various services' docker-compose.yml files to streamline network management. - This change simplifies the setup and ensures consistency across blueprints. * chore: upgrade Infisical from v0.90.1 to v0.135.0 (#529) * chore: upgrade Infisical from v0.90.1 to v0.135.0 * Update docker-compose.yml --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> * fix: update pull request template link for clarity - Changed the link in the pull request template from 'general suggestions' to 'general requirements' to better reflect the content and ensure users follow the correct guidelines when creating templates. * chore: add section for screenshots or videos in pull request template - Introduced a new section in the pull request template to encourage contributors to include screenshots or videos, enhancing the clarity and context of their submissions. * Feat : Add MuleSoft ESB Runtime Template (#498) * added the mulesoft esb template * updated the compose and the meta.json * feat(mulesoft-esb): update image and add dynamic env configuration - Updated image to hari1367709/mule-esb:latest - Added dynamic HTTP_PORT for runtime port configuration - Added MULE_VERSION environment variable for Mule ESB version selection * updated the meta.json to use the version as latest * added a comment line to the template file * updated the mule runtime image * fix(mulesoft-esb): update ports configuration to follow guidelines * updated the port to use the env(HTTP_PORT) * Update docker-compose.yml * Update docker-compose.yml * Update blueprints/mulesoft-esb/docker-compose.yml --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> * feat(blueprint): update trmnl-byos-laravel template (#533) * feat(blueprint): update trmnl-byos-laravel template * Update docker-compose.yml --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> * feat(blueprint): peerdb template (#579) * feat(blueprint): initial attempt at peerdb template * fix: entrypoint and healthcheck * fix: entrypoint * fix: temporarily remove network * fix: temporal port * chore: remove 36987 for minio * fix: remove peerdb 9900 port exposure * fix: port for console * fix: minio env fix * fix: expose peerdb and minio to dokploy network * fix(peerdb): add defaults * fix: remove extra hosts * fix: remove network entries * fix: use consistent environment variables * feat: add Bluesky PDS template (#542) * feat: Bluesky PDS template * chore: add bluesky pds svg * chore: metadata for bluesky pds * yaml > yml * pnpm lock * fix: correct rotation key config * fix volumes * fix: volumes in the pds compose * define volumes in compose * fix: 32 bit rotation key * create pds.env correctly * some extra fixes * more extra fixes * a blank line * update pnpm lock * Add dokploy-prom-monitoring-extension template with comprehensive tests and documentation (#548) * Add dokploy-prom-monitoring-extension template with comprehensive tests and documentation * Fix METRICS_CONFIG environment variable: use single-line JSON format * Fix template.toml: use correct [config.env] syntax for environment variables * Fix docker-compose.yml: add env_file reference to load environment variables * Delete blueprints/dokploy-prom-monitoring-extension/README.md * Delete test-dokploy-prom-monitoring-extension.sh --------- Co-authored-by: Sanjeevi Subramani <ssanjeevi.ss@gmail.com> Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> * feat: improve RustDesk template configuration (#571) * feat: improve RustDesk template configuration - Add comprehensive environment variables for RustDesk server - Add RELAY_HOST, API_SERVER, ID_SERVER, and ENCRYPTION_KEY variables - Follow Dokploy best practices (no container_name, proper port format) - Use restart: unless-stopped policy - Add encryption key generation with password helper * fix: use explicit port mapping for RustDesk services RustDesk requires explicit port bindings (host:container format) to function properly. The service uses specific ports for: - 21115-21116 (TCP/UDP): hbbs service for ID and NAT traversal - 21117-21119 (TCP): hbbr relay service Without explicit port mapping, RustDesk clients cannot establish connections to the server. This is an exception to Dokploy's general port guidelines due to RustDesk's specific networking requirements. --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> * feat: add Mumble voice chat server template (#572) * feat: add Mumble voice chat server template - Add Mumble VoIP server blueprint with docker-compose.yml - Configure environment variables for superuser password, welcome text, and max users - Add template.toml with auto-generated secure password - Follow Dokploy best practices (no container_name, proper port format) - Add Mumble metadata to meta.json with proper tags - Support for TCP and UDP on port 64738 * Update template.toml * fix: correct JSON formatting in meta.json for Mumble template entry --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Co-authored-by: Mauricio Siu <siumauricio@icloud.com> * fix: update WireGuard Easy template for proper functionality (#573) * fix: update WireGuard Easy template for proper functionality - Changed to named volume (etc_wireguard) instead of host path mount - Added explicit port mappings (51820:51820/udp, 51821:51821/tcp) required for WireGuard - Updated environment variables to use correct WG_HOST and PASSWORD format - Added all required WireGuard environment variables: - WG_PORT, PORT, WG_MTU, WG_DEFAULT_DNS, WG_ALLOWED_IPS - WG_POST_UP/WG_POST_DOWN for iptables rules - Added NET_RAW capability for proper network operations - Simplified template.toml to use WIREGUARD_HOST and WIREGUARD_PASSWORD - Removed explicit networks config to enable Dokploy's isolated deployment - Template now works with Dokploy's automatic network isolation This configuration has been tested and confirmed working with isolated deployment enabled. * Update template.toml --------- Co-authored-by: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> * add: restart policy to MinIO service (#576) restart: unless-stopped is a Docker restart policy that automatically restarts a container if it stops due to an error or Docker daemon restart --------- Co-authored-by: Sunil Shrestha <sunil.shrestha@tekkon.com.np> Co-authored-by: Rabithua <rabithua@gmail.com> Co-authored-by: Mauricio Siu <siumauricio@hotmail.com> Co-authored-by: Scan <103391616+scanash00@users.noreply.github.com> Co-authored-by: Crackvignoule <kiki.kalagan@gmail.com> Co-authored-by: florianheysen <39408021+florianheysen@users.noreply.github.com> Co-authored-by: Thiago MadPin <madpin@gmail.com> Co-authored-by: BlinkStrike <18644035+BlinkStrike@users.noreply.github.com> Co-authored-by: M Jupri Amin <127651222+Juupeee@users.noreply.github.com> Co-authored-by: Harikrishnan Dhanasekaran <harikrishnan@mulecraft.in> Co-authored-by: Kamil Dzieniszewski <kamil.dzieniszewski@gmail.com> Co-authored-by: Nick Anderson <nbrookie@gmail.com> Co-authored-by: lefolalan <alan.lefol@omirion.com> Co-authored-by: Chris <31969757+ChrisvanChip@users.noreply.github.com> Co-authored-by: kipavy <88386090+kipavy@users.noreply.github.com> Co-authored-by: Benjamin Nussbaum <bnussbau@users.noreply.github.com> Co-authored-by: Khiet Tam Nguyen <86177399+nktnet1@users.noreply.github.com> Co-authored-by: Vidhya LKG for IT <24915474+VidhyaSanjeevi@users.noreply.github.com> Co-authored-by: Sanjeevi Subramani <ssanjeevi.ss@gmail.com> Co-authored-by: Muzaffer Kadir YILMAZ <34358176+muzafferkadir@users.noreply.github.com> Co-authored-by: Jemg <murksopps@gmail.com>
1 parent 3fcc9f2 commit 53c2ddb

File tree

106 files changed

+15684
-5217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+15684
-5217
lines changed

.github/PULL_REQUEST_TEMPLATE/pull_request_template.md renamed to .github/pull_request_template.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ New PR of [Template Name]
66

77
Before submitting this PR, please make sure that:
88

9-
- [ ] I have read the suggestions in the README.md file https://github.com/Dokploy/templates?tab=readme-ov-file#general-suggestions-when-creating-a-template
9+
- [ ] I have read the suggestions in the README.md file https://github.com/Dokploy/templates?tab=readme-ov-file#general-requirements-when-creating-a-template
1010
- [ ] I have tested the template in my instance, so the maintainers don't spend time trying to figure out what's wrong.
1111
- [ ] I have added tests that demonstrate that my correction works or that my new feature works.
1212

1313
## Issues related (if applicable)
1414

15-
Close automatically the related issues using the keywords: `closes #ISSUE_NUMBER`, `fixes #ISSUE_NUMBER`, `resolves #ISSUE_NUMBER`
15+
Close automatically the related issues using the keywords: `closes #ISSUE_NUMBER`
1616

17-
Example: `closes #123`
17+
18+
## Screenshots or Videos

.github/workflows/deploy-preview.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ on:
55
workflows: [Build Preview Deployment]
66
types:
77
- completed
8-
8+
pull_request:
9+
branches:
10+
- canary
911
permissions:
1012
actions: read
1113
deployments: write
File renamed without changes.
Lines changed: 317 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,317 @@
1+
name: Validate Docker Compose Files
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- canary
7+
paths:
8+
- 'blueprints/**/docker-compose.yml'
9+
- 'blueprints/**/template.toml'
10+
workflow_dispatch:
11+
12+
jobs:
13+
validate-docker-compose:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0 # Necesitamos el historial completo para comparar con base
21+
22+
- name: Set up Docker Compose
23+
run: |
24+
echo "🐳 Setting up Docker Compose..."
25+
# Docker Compose V2 viene preinstalado en ubuntu-latest
26+
docker compose version
27+
28+
- name: Set up Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 20.16.0
32+
33+
- name: Set up pnpm
34+
uses: pnpm/action-setup@v4
35+
with:
36+
version: 8
37+
38+
- name: Install dependencies
39+
run: |
40+
echo "📦 Installing Node.js dependencies..."
41+
cd build-scripts && pnpm install
42+
43+
- name: Get changed files
44+
id: changed-files
45+
run: |
46+
echo "🔍 Detecting changed files..."
47+
48+
# Obtener la rama base
49+
BASE_SHA=$(git merge-base HEAD origin/${{ github.base_ref }})
50+
51+
# Encontrar todos los archivos docker-compose.yml y template.toml modificados/agregados
52+
CHANGED_COMPOSE=$(git diff --name-only --diff-filter=ACMRT $BASE_SHA HEAD | grep -E 'blueprints/.*/docker-compose\.yml$' || true)
53+
CHANGED_TOML=$(git diff --name-only --diff-filter=ACMRT $BASE_SHA HEAD | grep -E 'blueprints/.*/template\.toml$' || true)
54+
55+
# Crear lista de directorios únicos que tienen cambios
56+
CHANGED_DIRS=$(echo -e "$CHANGED_COMPOSE\n$CHANGED_TOML" | sed 's|blueprints/\([^/]*\)/.*|\1|' | sort -u)
57+
58+
echo "Changed compose files:"
59+
echo "$CHANGED_COMPOSE" | while read file; do [ -n "$file" ] && echo " - $file"; done
60+
61+
echo "Changed TOML files:"
62+
echo "$CHANGED_TOML" | while read file; do [ -n "$file" ] && echo " - $file"; done
63+
64+
echo "Changed directories:"
65+
echo "$CHANGED_DIRS" | while read dir; do [ -n "$dir" ] && echo " - $dir"; done
66+
67+
# Guardar para usar en siguientes pasos
68+
echo "compose_files<<EOF" >> $GITHUB_OUTPUT
69+
echo "$CHANGED_COMPOSE" >> $GITHUB_OUTPUT
70+
echo "EOF" >> $GITHUB_OUTPUT
71+
72+
echo "toml_files<<EOF" >> $GITHUB_OUTPUT
73+
echo "$CHANGED_TOML" >> $GITHUB_OUTPUT
74+
echo "EOF" >> $GITHUB_OUTPUT
75+
76+
echo "directories<<EOF" >> $GITHUB_OUTPUT
77+
echo "$CHANGED_DIRS" >> $GITHUB_OUTPUT
78+
echo "EOF" >> $GITHUB_OUTPUT
79+
80+
- name: Validate Docker Compose files syntax
81+
id: validate-compose-syntax
82+
run: |
83+
echo "🔍 Validating Docker Compose files syntax..."
84+
85+
ERROR=0
86+
COMPOSE_FILES="${{ steps.changed-files.outputs.compose_files }}"
87+
88+
if [ -z "$COMPOSE_FILES" ]; then
89+
echo "ℹ️ No docker-compose.yml files changed, skipping validation"
90+
exit 0
91+
fi
92+
93+
echo "$COMPOSE_FILES" | while read -r compose_file; do
94+
if [ -z "$compose_file" ]; then
95+
continue
96+
fi
97+
98+
TEMPLATE_DIR=$(dirname "$compose_file")
99+
TEMPLATE_NAME=$(basename "$TEMPLATE_DIR")
100+
101+
echo ""
102+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
103+
echo "📦 Validating syntax: $TEMPLATE_NAME"
104+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
105+
106+
# Validar sintaxis de docker-compose.yml usando docker compose
107+
echo "🔍 Validating docker-compose.yml syntax..."
108+
if ! docker compose -f "$compose_file" config > /dev/null 2>&1; then
109+
echo "❌ ERROR: docker-compose.yml syntax is invalid in $TEMPLATE_NAME"
110+
echo "Running docker compose config to show errors:"
111+
docker compose -f "$compose_file" config 2>&1 || true
112+
ERROR=1
113+
else
114+
echo "✅ docker-compose.yml syntax is valid"
115+
fi
116+
117+
# Obtener lista de servicios del compose
118+
SERVICES=$(docker compose -f "$compose_file" config --services 2>/dev/null || echo "")
119+
echo "📋 Services found in docker-compose.yml:"
120+
echo "$SERVICES" | while read service; do
121+
[ -n "$service" ] && echo " - $service"
122+
done
123+
124+
# Guardar servicios para validación posterior
125+
echo "$SERVICES" > "/tmp/${TEMPLATE_NAME}_services.txt"
126+
done
127+
128+
if [ $ERROR -eq 1 ]; then
129+
echo ""
130+
echo "❌ Docker Compose syntax validation failed"
131+
exit 1
132+
else
133+
echo ""
134+
echo "✅ All Docker Compose files have valid syntax"
135+
fi
136+
137+
- name: Validate Docker Compose best practices
138+
id: validate-compose-practices
139+
run: |
140+
echo "🔍 Validating Docker Compose best practices..."
141+
142+
ERROR=0
143+
COMPOSE_FILES="${{ steps.changed-files.outputs.compose_files }}"
144+
145+
if [ -z "$COMPOSE_FILES" ]; then
146+
echo "ℹ️ No docker-compose.yml files changed, skipping validation"
147+
exit 0
148+
fi
149+
150+
# Convert to array to avoid subshell issues with pipe
151+
# This ensures ERROR=1 inside the loop propagates to the parent shell
152+
mapfile -t COMPOSE_ARRAY <<< "$COMPOSE_FILES"
153+
154+
for compose_file in "${COMPOSE_ARRAY[@]}"; do
155+
if [ -z "$compose_file" ]; then
156+
continue
157+
fi
158+
159+
TEMPLATE_DIR=$(dirname "$compose_file")
160+
TEMPLATE_NAME=$(basename "$TEMPLATE_DIR")
161+
162+
echo ""
163+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
164+
echo "📦 Validating best practices: $TEMPLATE_NAME"
165+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
166+
167+
# Validar usando el script de TypeScript
168+
if ! (cd build-scripts && pnpm exec tsx validate-docker-compose.ts --file "../$compose_file" --verbose); then
169+
ERROR=1
170+
fi
171+
done
172+
173+
if [ $ERROR -eq 1 ]; then
174+
echo ""
175+
echo "❌ Docker Compose best practices validation failed"
176+
exit 1
177+
else
178+
echo ""
179+
echo "✅ All Docker Compose files follow best practices"
180+
fi
181+
182+
- name: Validate template.toml files
183+
id: validate-toml
184+
run: |
185+
echo "🔍 Validating template.toml files..."
186+
187+
ERROR=0
188+
DIRECTORIES="${{ steps.changed-files.outputs.directories }}"
189+
190+
if [ -z "$DIRECTORIES" ]; then
191+
echo "ℹ️ No template directories changed, skipping TOML validation"
192+
exit 0
193+
fi
194+
195+
# Convert to array to avoid subshell issues with pipe
196+
# This ensures ERROR=1 inside the loop propagates to the parent shell
197+
mapfile -t DIRS_ARRAY <<< "$DIRECTORIES"
198+
199+
for template_dir in "${DIRS_ARRAY[@]}"; do
200+
if [ -z "$template_dir" ]; then
201+
continue
202+
fi
203+
204+
TEMPLATE_PATH="blueprints/$template_dir"
205+
TOML_FILE="$TEMPLATE_PATH/template.toml"
206+
207+
if [ ! -f "$TOML_FILE" ]; then
208+
echo "⚠️ WARNING: template.toml not found in $template_dir (might be deleted)"
209+
continue
210+
fi
211+
212+
echo ""
213+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
214+
echo "📝 Validating: $template_dir/template.toml"
215+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
216+
217+
# Validar usando el script de TypeScript con tsx
218+
# Ejecutar desde build-scripts para tener acceso a node_modules
219+
if ! (cd build-scripts && pnpm exec tsx validate-template.ts --dir "../$TEMPLATE_PATH" --verbose); then
220+
ERROR=1
221+
fi
222+
done
223+
224+
if [ $ERROR -eq 1 ]; then
225+
echo ""
226+
echo "❌ template.toml validation failed"
227+
exit 1
228+
else
229+
echo ""
230+
echo "✅ All template.toml files are valid"
231+
fi
232+
233+
- name: Test Docker Compose (dry-run)
234+
id: test-compose
235+
run: |
236+
echo "🧪 Testing Docker Compose files (dry-run)..."
237+
238+
ERROR=0
239+
DIRECTORIES="${{ steps.changed-files.outputs.directories }}"
240+
241+
if [ -z "$DIRECTORIES" ]; then
242+
echo "ℹ️ No template directories changed, skipping dry-run test"
243+
exit 0
244+
fi
245+
246+
echo "$DIRECTORIES" | while read -r template_dir; do
247+
if [ -z "$template_dir" ]; then
248+
continue
249+
fi
250+
251+
COMPOSE_FILE="blueprints/$template_dir/docker-compose.yml"
252+
253+
if [ ! -f "$COMPOSE_FILE" ]; then
254+
continue
255+
fi
256+
257+
echo ""
258+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
259+
echo "🧪 Testing: $template_dir"
260+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
261+
262+
# Cambiar al directorio del template para resolver rutas relativas
263+
cd "blueprints/$template_dir"
264+
265+
# Validar que docker-compose puede parsear el archivo completamente
266+
echo "🔍 Running docker compose config (full validation)..."
267+
if docker compose config > /dev/null 2>&1; then
268+
echo "✅ Docker Compose file is fully valid and can be processed"
269+
270+
# Mostrar información útil
271+
echo "📋 Configuration summary:"
272+
docker compose config --services | while read service; do
273+
[ -n "$service" ] && echo " Service: $service"
274+
done
275+
else
276+
echo "❌ ERROR: Docker Compose file failed full validation"
277+
docker compose config 2>&1 || true
278+
ERROR=1
279+
fi
280+
281+
cd - > /dev/null
282+
done
283+
284+
if [ $ERROR -eq 1 ]; then
285+
echo ""
286+
echo "❌ Docker Compose dry-run test failed"
287+
exit 1
288+
else
289+
echo ""
290+
echo "✅ All Docker Compose files passed dry-run test"
291+
fi
292+
293+
- name: Summary
294+
if: always()
295+
run: |
296+
echo ""
297+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
298+
echo "📊 Validation Summary"
299+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
300+
301+
if [ "${{ steps.validate-compose-syntax.outcome }}" == "success" ] && \
302+
[ "${{ steps.validate-compose-practices.outcome }}" == "success" ] && \
303+
[ "${{ steps.validate-toml.outcome }}" == "success" ] && \
304+
[ "${{ steps.test-compose.outcome }}" == "success" ]; then
305+
echo "✅ All validations passed!"
306+
echo ""
307+
echo "Your Docker Compose and template.toml files are valid and ready to merge."
308+
else
309+
echo "❌ Some validations failed. Please review the errors above."
310+
echo ""
311+
echo "Common issues to check:"
312+
echo " - docker-compose.yml syntax errors"
313+
echo " - template.toml syntax errors"
314+
echo " - serviceName in template.toml must match service names in docker-compose.yml"
315+
echo " - Avoid using container_name, explicit networks, or port mappings"
316+
fi
317+

.github/workflows/validate-meta.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Validate and Process Meta.json
22

33
on:
44
push:
5-
branches: [main, master, develop]
5+
branches: [canary]
66
paths: ["meta.json"]
77
pull_request:
8-
branches: [main, master]
8+
branches: [canary]
99
paths: ["meta.json"]
1010
workflow_dispatch:
1111

.github/workflows/validate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Validate Blueprints Structure and Meta
33
on:
44
pull_request:
55
branches:
6-
- main
6+
- canary
77
push:
88
branches:
9-
- main
9+
- canary
1010

1111
jobs:
1212
validate:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ We have a few helpers that are very common when creating a template, these are:
170170

171171

172172

173-
## General Suggestions when creating a template
173+
## General Requirements when creating a template
174174

175175
- Don't use this way in your docker compose file:
176176

@@ -225,4 +225,4 @@ services:
225225
6. Now you can click on the Deploy Button and wait for the deployment to finish, and try to access to the service, if everything is correct you should access to the service and see the template working.
226226

227227

228-
use the command `node dedupe-and-sort-meta.js` to deduplicate and sort the meta.json file.
228+
use the command `node dedupe-and-sort-meta.js` to deduplicate and sort the meta.json file.

0 commit comments

Comments
 (0)