mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 15:35:55 +01:00
♻️ Change Docker instance to singleton
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { NextApiRequest, NextApiResponse } from 'next';
|
||||
|
||||
import Docker from 'dockerode';
|
||||
import DockerSingleton from './DockerSingleton';
|
||||
|
||||
async function Get(req: NextApiRequest, res: NextApiResponse) {
|
||||
try {
|
||||
const docker = new Docker();
|
||||
const docker = DockerSingleton.getInstance();
|
||||
const containers = await docker.listContainers({ all: true });
|
||||
res.status(200).json(containers);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user