diff --git a/apps/docs/content/docs/core/docker-compose/index.mdx b/apps/docs/content/docs/core/docker-compose/index.mdx index 5d24dd6..9c9ea50 100644 --- a/apps/docs/content/docs/core/docker-compose/index.mdx +++ b/apps/docs/content/docs/core/docker-compose/index.mdx @@ -73,6 +73,8 @@ volumes: - "../files/my-configs:/etc/my-app/config" ✅ ``` +**Important:** If you need to use files from your repository (configuration files, scripts, etc.), you must move them to Dokploy's File Mounts (via Advanced → Mounts) instead of mounting them directly from the repository. When using AutoDeploy, Dokploy performs a `git clone` on each deployment, which clears the repository directory. Mounting files directly from your repository using relative paths (e.g., `./` or `./config/file.conf`) will cause them to be lost or empty in subsequent deployments. See the [Troubleshooting guide](/docs/core/troubleshooting#using-files-from-your-repository) for more details. + ## Keyboard Shortcuts diff --git a/apps/docs/content/docs/core/troubleshooting.mdx b/apps/docs/content/docs/core/troubleshooting.mdx index 011e0d3..7c1f01d 100644 --- a/apps/docs/content/docs/core/troubleshooting.mdx +++ b/apps/docs/content/docs/core/troubleshooting.mdx @@ -54,6 +54,46 @@ volumes: - "../files/my-configs:/etc/my-app/config" ✅ ``` +### Using Files from Your Repository + + + If you need to use files from your repository (e.g., configuration files, scripts, or directories), you **must** move them to Dokploy's file mounts and reference them manually using the Dokploy interface. This is because when using AutoDeploy, Dokploy performs a `git clone` operation on each deployment, which clears the repository directory. If you mount files directly from your repository using relative paths like `./` or `./docker/config/odoo.conf`, these files will be lost or empty in subsequent deployments, even though the first deployment may work correctly. + + +**Why this happens:** +- On the first deployment, the files exist and are mounted correctly +- On subsequent deployments, Dokploy cleans the directory and performs a fresh `git clone` +- Docker loses the reference to the files that were in the filesystem, and the new files have a new reference +- This causes mounted directories and files to be empty or missing inside the container + +**Solution:** +1. Go to **Advanced** → **Mounts** in your Docker Compose application +2. Create a new **File Mount** for each file or directory you need from your repository +3. Copy the content from your repository files into the File Mount content field +4. Specify the file path for your configuration +5. Reference the file mount in your `docker-compose.yml` using the `../files/` path: + +```yaml +volumes: + - "../files/my-config.json:/etc/my-app/config" ✅ + - "../files/my-directory:/path/in/container" ✅ +``` + +**Example:** +Instead of mounting directly from your repository: +```yaml +volumes: + - ./:/mnt/extra-addons/va_subscription_18 ❌ + - ./docker/config/odoo.conf:/etc/odoo/odoo.conf ❌ +``` + +Use Dokploy's file mounts: +```yaml +volumes: + - ../files/va_subscription_18:/mnt/extra-addons/va_subscription_18 ✅ + - ../files/odoo.conf:/etc/odoo/odoo.conf ✅ +``` + ## Logs Not Loading When Deploying to a Remote Server? There are a few potential reasons for this: @@ -204,6 +244,10 @@ volumes: - ../files/my-config.json:/etc/my-app/config ``` + + **Important for AutoDeploy users:** If you have configuration files or directories in your repository that you need to mount into your containers, you must copy their content to Dokploy's File Mounts (via Advanced → Mounts) instead of mounting them directly from the repository. This ensures the files persist across deployments, as the repository directory is cleaned and re-cloned on each AutoDeploy. + + ## Failed to initialize Docker Swarm