refactor: Standardize template domain configuration to use ${domain} helper

This commit is contained in:
Mauricio Siu 2025-03-10 00:09:22 -06:00
parent e90c2cdba1
commit 736503f855
111 changed files with 236 additions and 257 deletions

View File

@ -1,66 +0,0 @@
name: Generate Base64 Blueprints Table
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
encode-and-comment:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Generate base64 for blueprints
id: generate
run: |
echo "### 📝 Blueprints Base64 Table" > comment.md
echo '' >> comment.md
echo "You can use the base64 value to import the blueprint into the UI." >> comment.md
echo "<details>" >> comment.md
echo "<summary>🔍 Show all blueprints base64</summary>" >> comment.md
echo '' >> comment.md
for dir in blueprints/*; do
if [ -d "$dir" ]; then
TEMPLATE_NAME=$(basename "$dir")
COMPOSE_FILE="$dir/docker-compose.yml"
TEMPLATE_FILE="$dir/template.yml"
if [ -f "$COMPOSE_FILE" ] && [ -f "$TEMPLATE_FILE" ]; then
COMPOSE_CONTENT=$(jq -Rs . < "$COMPOSE_FILE")
TEMPLATE_CONTENT=$(jq -Rs . < "$TEMPLATE_FILE")
JSON="{\"compose\":$COMPOSE_CONTENT,\"config\":$TEMPLATE_CONTENT}"
BASE64_JSON=$(echo -n "$JSON" | base64 -w 0)
echo "#### $TEMPLATE_NAME" >> comment.md
echo '' >> comment.md
echo '```' >> comment.md
echo "$BASE64_JSON" >> comment.md
echo '```' >> comment.md
echo ''
fi
fi
done
echo '</details>' >> comment.md
- name: Post comment to PR
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
path: comment.md
- name: Post comment to commit (fallback)
uses: peter-evans/commit-comment@v3
if: github.event_name != 'pull_request'
with:
body-path: comment.md

View File

@ -1,32 +0,0 @@
name: Deploy PR previews
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
concurrency: preview-${{ github.ref }}
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Si no tienes build, solo copia los archivos
- name: Prepare static preview folder
run: |
mkdir -p preview
cp meta.json preview/
cp -r blueprints preview/
cp index.html preview/
# Despliega el preview usando el action
- uses: rossjrw/pr-preview-action@v1
with:
source-dir: preview

161
README.md
View File

@ -1,54 +1,131 @@
# React + TypeScript + Vite
# Dokploy Open Source Templates
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
This is the official repository for the Dokploy Open Source Templates.
Currently, two official plugins are available:
### How to add a new template
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
1. Clone the repository
2. Add the template to the `blueprints` folder (docker-compose.yml, template.yml)
3. Add the template metadata (name, description, version, logo, links, tags) to the `meta.json` file
4. Add the logo to the template folder
5. Commit and push your changes
6. Create a pull request
## Expanding the ESLint configuration
### Example
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
Let's suppose you want to add the [Grafana](https://grafana.com/) template to the repository.
```js
export default tseslint.config({
extends: [
// Remove ...tseslint.configs.recommended and replace with this
...tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
...tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
...tseslint.configs.stylisticTypeChecked,
],
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
1. Create a new folder inside the `blueprints` folder named `grafana`
2. Add the `docker-compose.yml` file to the folder
```yaml
version: "3.8"
services:
grafana:
image: grafana/grafana-enterprise:9.5.20
restart: unless-stopped
volumes:
- grafana-storage:/var/lib/grafana
volumes:
grafana-storage: {}
```
3. Add the `template.yml` file to the folder, this is where we specify the domains, mounts and env variables, to understand more the structure of `template.yml` you can read here []
```yaml
variables:
main_domain: ${domain}
config:
domains:
- serviceName: grafana
port: 3000
host: ${main_domain}
env: []
mounts: []
```
4. Add the `meta.json` file to the folder
```json
{
"id": "grafana",
"name": "Grafana",
"version": "9.5.20",
"description": "Grafana is an open source platform for data visualization and monitoring.",
"logo": "grafana.svg",
"links": {
"github": "https://github.com/grafana/grafana",
"website": "https://grafana.com/",
"docs": "https://grafana.com/docs/"
},
"tags": [
"monitoring"
]
},
},
})
```
5. Add the logo to the folder
6. Commit and push your changes
7. Create a pull request
### Template.yml structure
Dokploy use a defined structure for the `template.yml` file, we have 4 sections available:
1. `variables`: This is where we define the variables that will be used in the `config` section.
2. `config`: This is where we define the configuration for the template.
3. `env`: This is where we define the environment variables for the template.
4. `mounts`: This is where we define the mounts for the template.
1. the `variables(Optional)` structure is the following:
```yaml
1. variables:
main_domain: ${domain}
2. variables:
my-domain: https://my-domain.com
```
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
2. the `config` structure is the following:
```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
```yaml
1. config:
domains: # Optional
- serviceName: grafana # Required
port: 3000 # Required
host: ${main_domain} # Required
path: / -> Optional
export default tseslint.config({
plugins: {
// Add the react-x and react-dom plugins
'react-x': reactX,
'react-dom': reactDom,
},
rules: {
// other rules...
// Enable its recommended typescript rules
...reactX.configs['recommended-typescript'].rules,
...reactDom.configs.recommended.rules,
},
})
env: # Optional
- AP_HOST=${main_domain}
- AP_API_KEY=${api_key}
- AP_ENCRYPTION_KEY=${encryption_key}
- AP_JWT_SECRET=${jwt_secret}
- AP_POSTGRES_PASSWORD=${postgres_password}
mounts: # Optional or []
- filePath: /content/file.txt
content: |
My content
```
Important: you can reference any variable in the `domains`, `env` and `mounts` sections. just use the `${variable_name}` syntax, in the case you don't want to define a variable, you can use the `domain`, `base64`, `password`, `hash`, `uuid`, `randomPort` or `timestamp` helpers.
### Helpers
We have a few helpers that are very common when creating a template, these are:
- `domain`: This is a helper that will generate a random domain for the template.
- `base64 or base64:length`: This is a helper that will encode a string to base64.
- `password or password:length`: This is a helper that will generate a random password for the template.
- `hash or hash:length`: This is a helper that will generate a hash for the template.
- `uuid`: This is a helper that will generate a uuid for the template.
- `randomPort`: This is a helper that will generate a random port for the template.
- `timestamp`: This is a helper that will generate a timestamp.
- `jwt or jwt:length`: This is a helper that will generate a jwt for the template.

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
api_key: ${password:32}
encryption_key: ${password:32}
jwt_secret: ${password:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
service_hash: ${hash:32}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
auth_secret: ${base64:32}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
browserless_token: ${password:16}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
api_key: ${password:32}
encryption_key: ${password:32}
jwt_secret: ${password:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
calcom_encryption_key: ${base64:32}
nextauth_secret: ${base64:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
secret_key_base: ${base64:64}
postgres_password: ${password}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
postgres_password: ${password}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
registration_token: ${password:20}
config:

View File

@ -1,7 +1,7 @@
variables:
dashboard_domain: ${randomDomain}
backend_domain: ${randomDomain}
actions_domain: ${randomDomain}
dashboard_domain: ${domain}
backend_domain: ${domain}
actions_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
username: ${password:16}
password: ${password:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
directus_secret: ${base64:64}
database_password: ${password}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
mysql_password: ${password}
mysql_root_password: ${password}
mysql_user: tickets

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
postgres_password: ${password}
redis_password: ${password}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
postgres_password: ${password}
app_secret: ${password}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
nextauth_secret: ${base64:32}
encryption_key: ${password:32}
secondary_encryption_key: ${password:64}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
secret_key_base: ${base64:64}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,6 +1,6 @@
variables:
main_domain: ${randomDomain}
api_domain: ${randomDomain}
main_domain: ${domain}
api_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
db_root_password: ${password:32}
admin_password: ${password:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
api_key: ${base64:64}
postgres_password: ${password}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
secret_base: ${base64:64}
encryption_key: ${base64:48}
cron_secret: ${base64:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
db_root_password: ${password:32}
admin_password: ${password:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
secret_key: ${base64:32}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
username: gotenberg
password: changethis

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
session_key: ${base64:64}
form_encryption_key: ${base64:64}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
postgres_password: ${password}
jwt_secret: ${password}
app_key: ${password}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
postgres_password: ${password}
next_secret: ${base64:32}
meili_master_key: ${base64:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
secret_key: ${password:64}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
huly_secret: ${base64:64}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
db_password: ${password}
db_user: immich

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
postgres_password: ${password}
postgres_user: infisical
postgres_db: infisical

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
db_password: ${password}
db_username: "invoiceshelf"
db_database: "invoiceshelf"

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
admin_password: ${password:32}
mysql_password: ${password:32}
mysql_root_password: ${password:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
db_password: ${password}
db_username: "langflow"

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
postgres_password: ${password}
next_secret: ${base64:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,6 +1,6 @@
variables:
main_domain: ${randomDomain}
admin_domain: ${randomDomain}
main_domain: ${domain}
admin_domain: ${domain}
postgres_password: ${password}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
default_password: ${password}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
secret_key_base: ${base64:64}
synth_api_key: ${base64:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
master_key: ${base64:32}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,6 +1,6 @@
variables:
main_domain: ${randomDomain}
api_domain: ${randomDomain}
main_domain: ${domain}
api_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
db_password: ${password}
db_root_password: ${password}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
jwt_secret: ${base64:64}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,6 +1,6 @@
variables:
main_domain: ${randomDomain}
dex_domain: ${randomDomain}
main_domain: ${domain}
dex_domain: ${domain}
secret_key: ${base64:32}
utils_secret: ${base64:32}
client_secret: ${base64:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,6 +1,6 @@
variables:
main_domain: ${randomDomain}
api_domain: ${randomDomain}
main_domain: ${domain}
api_domain: ${domain}
postgres_password: ${password}
secret: ${base64:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
admin_password: ${password}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
root_password: ${password:32}
user_password: ${password:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
secret_base: ${base64:64}
totp_key: ${base64:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
db_password: ${password}
db_user: "postiz"
db_name: "postiz"

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
registry_http_secret: ${password:30}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
postgres_password: ${password}
admin_access_token: ${base64:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
initial_api_key: ${password:30}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
db_password: ${password}
db_user: "slash"
db_name: "slash"

View File

@ -1,6 +1,6 @@
variables:
main_domain: ${randomDomain}
metrics_domain: ${randomDomain}
main_domain: ${domain}
metrics_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
secret_key: ${password}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
postgres_password: ${password:32}
jwt_secret: ${base64:32}
dashboard_password: ${password:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
secret_key: ${password:30}
postgres_password: ${password:30}
redis_password: ${password:30}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
db_password: ${password}
public_db_port: ${randomPort}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
jwt_secret: ${base64:32}
config:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
magic_link_secret: ${base64:16}
session_secret: ${base64:16}
encryption_key: ${base64:32}

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
config:
domains:

View File

@ -1,5 +1,5 @@
variables:
main_domain: ${randomDomain}
main_domain: ${domain}
db_password: ${password}
db_user: "twenty"
app_secret: ${base64:32}

Some files were not shown because too many files have changed in this diff Show More