docs: add documentation for shared variables, preview deployments, and HTTPS configuration

This commit is contained in:
Mauricio Siu 2025-02-23 17:17:41 -06:00
parent 1063ecda82
commit a4cb0fd5d9
8 changed files with 137 additions and 1 deletions

View File

@ -0,0 +1,65 @@
---
title: Preview Deployments
description: "Preview deployments allow you to test and review your application changes in an isolated environment before merging to production."
---
Preview deployments are a powerful feature specifically designed for applications with GitHub integration. This feature is disabled by default but can be easily enabled to enhance your development workflow.
<ImageZoom src="/assets/images/preview-deployments.png" width={800} height={630} alt='Preview deployments' className="rounded-lg" />
## Configuration
By default, Dokploy generates dynamic domains using traefik.me domains, which are free and require no additional configuration. The default port is 3000, but you can adjust this based on your application's requirements. You can also limit the number of preview deployments per application (default is 3).
### Custom Domains
If you prefer using a custom domain, you can configure it like this:
```
*.mydomain.com
```
Dokploy will generate domains following this pattern:
```
preview-${appName}-${uniqueId}.traefik.me
```
To make this work, you need to point your wildcard DNS record (*) to your server's IP address.
## How It Works
Once enabled, preview deployments are automatically created whenever a pull request is opened against your target branch (configured in your provider settings).
For example:
- If your provider is configured to use the `main` branch
- And you create a pull request from `feature/new-feature` to `main`
- A preview deployment will be automatically created for the `feature/new-feature` branch
Note: Pull requests to branches other than your configured target branch will not trigger preview deployments.
### Monitoring Deployments
When you open a pull request, you can monitor the deployment progress in the preview deployments section:
<ImageZoom src="/assets/images/preview-deploy.png" width={800} height={630} alt='Preview deployments build' className="rounded-lg" />
In this section, you can:
- View the deployment status
- Access the preview URL once deployed
- Check build and deployment logs
- Monitor deployment updates
- Update domain configuration
### Automatic Updates
The preview deployment will automatically:
- Update with each new commit to the pull request
- Create a new build and deployment
- Clean up when the pull request is closed or merged
This continuous preview system allows teams to review and test changes in isolation before merging to production.
<Callout type="info">
If you have security or redirects created in your application, it will inherit the same configuration for the preview deployment.
</Callout>

View File

@ -18,4 +18,16 @@ We expose a UI to create and delete the certificates, we ask two fields:
<Callout type='warn'>
This action will create the files, but that doesn't mean it will work automatically. You need to adjust the Traefik configuration to use it, this configuration will make
to traefik can recognize the certificate.
</Callout>
</Callout>
## Traefik.me HTTPS Setup
By default, all the domains from `traefik.me` are HTTP only, if you want to use HTTPS you need to create a certificate and use it in the domain settings.
You need to download the full https://traefik.me/fullchain.pem and https://traefik.me/privkey.pem, this are valid for 30 days.s
The fullchain.pem paste in the `Certificate Data` field and the privkey.pem paste in the `Private Key` field.
Now when using the traefik.me domains, make sure to enable `HTTPS` toggle and select the certificate provider set `None`
If you want to remove the certificate, just remove the certificate and in your domains settings remove the `HTTPS` toggle.

View File

@ -3,12 +3,19 @@ title: Domains
description: This section outlines how to configure domains for your applications in Dokploy, ensuring that your applications are accessible via custom URLs.
---
import { Callout } from 'fumadocs-ui/components/callout';
import { Link } from 'next/link';
Dokploy Provide 2 ways to add a domain to your service:
1. **Free Domains** from Traefik.me
2. **Buy a domain** from one of the providers above
<Callout type="warn">
`traefik.me` domains are free, but they are limited to HTTP only, if you want to configure HTTPS for free domains
you can [Create a certificate](/docs/core/certificates#traefikme-https-setup) and use it in the domain settings.
</Callout>
If you don't have a domain, you can use our integrated free domains from Traefik.me in the Dokploy panel, without doing any configuration however is only for HTTP, if you want to have a HTTPS domain you need to buy a domain from one of the providers above.
Domains are supported for:

View File

@ -26,6 +26,7 @@
"ssh-keys",
"certificates",
"---Services---",
"variables",
"domains",
"applications",
"docker-compose",

View File

@ -0,0 +1,51 @@
---
title: Environment Variables
description: "Dokploy allows you to create and manage shared environment variables for your projects."
---
import { Callout } from "fumadocs-ui/components/callout";
## Overview
Shared environment variables allow you to:
- Define values once and use them across multiple services
- Maintain configuration consistency between services
- Centrally manage sensitive information
<ImageZoom src="/assets/images/shared-variables.png" width={800} height={630} alt='Shared variables panel' className="rounded-lg" />
## Practical Example
Let's consider a common scenario where you have:
- A PostgreSQL database
- Two services that need to connect to this database
### 1. Define Shared Variable
In the project's shared variables section, define:
```bash
DATABASE_URL=postgresql://postgres:postgres@database:5432/postgres
```
### 2. Use the Variable in Services
In each service's environment variables tab, reference the shared variable:
```bash
DATABASE_URL=${{project.DATABASE_URL}}
```
<Callout type="info">
Dokploy will automatically replace `${{project.DATABASE_URL}}` with the value defined in the project's shared variables.
</Callout>
## Best Practices
- Use shared variables for credentials and configurations that repeat across services
- Keep descriptive variable names
- Document the purpose of each variable for easier maintenance
You can use shared enviroment variables in all the services available in dokploy.

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB