mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-15 20:25:23 +02:00
feat: Add server-level GPU support for Docker Swarm deployments and API endpoint for setup
This commit is contained in:
@@ -37,3 +37,6 @@ export const paths = (isServer = false) => {
|
||||
REGISTRY_PATH: `${BASE_PATH}/registry`,
|
||||
};
|
||||
};
|
||||
|
||||
export const GPU_ENABLED = process.env.GPU_ENABLED === 'true';
|
||||
export const GPU_RESOURCE_NAME = 'DOCKER_RESOURCE_GPU';
|
||||
9
packages/server/src/utils/gpu-setup.ts
Normal file
9
packages/server/src/utils/gpu-setup.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { docker } from '../constants';
|
||||
|
||||
export async function setupGPUSupport() {
|
||||
await docker.swarmUpdate({
|
||||
TaskDefaults: {
|
||||
GenericResources: [{ DiscreteResourceSpec: { Kind: 'gpu', Value: 1 } }]
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user