From: charleswrayjr Date: Sat, 6 Sep 2025 14:02:19 +0000 (-0500) Subject: Testing get docker containers path. X-Git-Url: https://git.phasecustomsoft.com/stylesheets/style.css?a=commitdiff_plain;h=d944519131c7c4ec99e033c109c25b08150e076c;p=phs-api.git Testing get docker containers path. --- diff --git a/app.js b/app.js index 9058e77..7503355 100755 --- a/app.js +++ b/app.js @@ -12,6 +12,8 @@ const runOnce = require ( './src/middleware/custom-startup' ); const Routes = require( './src/routes' ); const phsdb = require( './src/phsdb' ); const fs = require('fs'); +const Docker = require('dockerode'); +const docker = new Docker({ socketPath: '/var/run/docker.sock' }); const sshConfig = { host:'192.168.1.62', port:22, username:'charles', privateKey:fs.readFileSync( '/home/node/.ssh/git-ui' ), }; @@ -32,6 +34,7 @@ app.use((req, res, next) => { global.phsdb = phsdb; global.fs = fs; global.sshConfig = sshConfig; +global.docker = docker; // noinspection JSCheckFunctionSignatures app.use( bodyParser.json( { diff --git a/src/controllers/docker.controller.js b/src/controllers/docker.controller.js index 4cd990b..f9b42ef 100644 --- a/src/controllers/docker.controller.js +++ b/src/controllers/docker.controller.js @@ -1,6 +1,4 @@ const { Client } = require( 'ssh2' ); -const Docker = require('dockerode'); -const docker = new Docker(); module.exports = { stopContainer:async ( req, res, next ) => {