Add full cross-platform path support
- Added automatic volume path translation in deployment (deploy.js) - Updated FileBrowser template to use /opt/ instead of hard-coded E:/ - Migrated self-updater.js to use centralized platformPaths module - Updated UI placeholders to use platform-neutral paths (/media/) - All paths now automatically adapt to Windows or Linux at runtime via process.platform detection
This commit is contained in:
@@ -106,13 +106,20 @@ module.exports = function(ctx, helpers) {
|
||||
throw new Error(`[DC-203] Port conflict detected: ${conflictDetails}. Please choose a different port.`);
|
||||
}
|
||||
|
||||
// Translate volume paths for cross-platform compatibility
|
||||
const translatedVolumes = (processedTemplate.docker.volumes || []).map(volume => {
|
||||
const [hostPath, ...rest] = volume.split(':');
|
||||
const translatedHost = platformPaths.toDockerMountPath(hostPath);
|
||||
return rest.length > 0 ? `${translatedHost}:${rest.join(':')}` : translatedHost;
|
||||
});
|
||||
|
||||
const containerConfig = {
|
||||
Image: processedTemplate.docker.image,
|
||||
name: containerName,
|
||||
ExposedPorts: {},
|
||||
HostConfig: {
|
||||
PortBindings: {},
|
||||
Binds: processedTemplate.docker.volumes || [],
|
||||
Binds: translatedVolumes,
|
||||
RestartPolicy: { Name: 'unless-stopped' },
|
||||
LogConfig: DOCKER.LOG_CONFIG
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user