-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
To Reproduce
Database restore fails when:
- The database is deployed using a custom Docker stack name (not the auto-generated Dokploy stack name)
To Reproduce
- Deploy a PostgreSQL database using a custom Docker stack name:
docker stack deploy -c postgres.docker-compose.yml -c postgres.docker-compose.external.yml my-postgres
Current vs. Expected behavior
Expected Behavior
Dokploy should successfully locate the PostgreSQL container regardless of the stack name used
Dokploy should detect the backup file format (.sql.gz = plain SQL, .dump or custom format = pg_restore) and use the appropriate tool
The restore should complete successfully
Actual Behavior
The restore command fails with "No such container: sh"
The container filter uses hardcoded labels that don't match custom stack names:
--filter "label=com.docker.stack.namespace=databases-app-oq9el4" --filter "label=com.docker.swarm.service.name=databases-app-oq9el4_postgres"
When the filter returns no containers, $CONTAINER_ID is empty, causing docker exec -i $CONTAINER_ID sh -c "..." to become docker exec -i sh -c "...", which fails
Provide environment information
Dokploy version 0.26.3Which area(s) are affected? (Select all that apply)
Databases
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
No response
Will you send a PR to fix it?
No