Skip to content

Fix Windows build: bundle compose.yml and config/ as Tauri resources, bootstrap to app data dir at startup#19

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-docker-compose-config-file
Draft

Fix Windows build: bundle compose.yml and config/ as Tauri resources, bootstrap to app data dir at startup#19
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-docker-compose-config-file

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

On production installs (Windows especially), compose.yml and config/ don't exist anywhere on the user's machine, so the CWD walk-up in project_root() always falls back empty and Docker Compose fails immediately.

Changes

  • tauri.conf.json — adds bundle.resources mapping to include compose.yml and config/{nginx,php,mariadb} in the app bundle.

  • utils.rs — introduces a static PROJECT_ROOT: OnceLock<PathBuf> and init_project_root(path). project_root() returns the stored value when initialized; falls back to the CWD walk-up only in dev/test contexts.

  • lib.rs — during setup(), resolves app.path().app_data_dir(), bootstraps missing bundled resources into it on first run (skipping existing files to preserve user customizations), then calls init_project_root():

match app.path().app_data_dir() {
    Ok(app_data_dir) => {
        if let Ok(resource_dir) = app.path().resource_dir() {
            ensure_resources_in_app_data(&resource_dir, &app_data_dir);
        }
        utils::init_project_root(app_data_dir);
    }
    Err(e) => error!("Failed to resolve app data dir: {}", e),
}

On first launch, compose.yml and the core config tree are copied to (e.g.) %APPDATA%\com.devwp.app\. All subsequent Docker Compose operations run from that stable, writable location on every platform.

Original prompt

This section details on the original issue you should resolve

<issue_title>Windows build - Docker Compose configuration file not found</issue_title>
<issue_description>Windows build - Docker Compose configuration file not found.

Most likely the compose.yml is excluded from the devwp data folder.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

… use app data dir as project root

Co-authored-by: SpiZeak <22522734+SpiZeak@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SpiZeak/DevWP/sessions/83b9e520-421c-4db9-874c-bab12bb650ac
Copilot AI changed the title [WIP] Fix Docker Compose configuration file not found in Windows build Fix Windows build: bundle compose.yml and config/ as Tauri resources, bootstrap to app data dir at startup Mar 24, 2026
Copilot AI requested a review from SpiZeak March 24, 2026 22:36
@github-actions
Copy link
Copy Markdown

PR Checks Summary

  • validate: success
  • integration-tests: success
  • test-docker: success
  • security-check: success
  • size-check: success

✅ All checks must pass before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows build - Docker Compose configuration file not found

2 participants