]> PHS Git Server - phs-api.git/commitdiff
Testing get docker containers path.
authorcharleswrayjr <charleswrayjr@gmail.com>
Sat, 6 Sep 2025 14:02:19 +0000 (09:02 -0500)
committercharleswrayjr <charleswrayjr@gmail.com>
Sat, 6 Sep 2025 14:02:19 +0000 (09:02 -0500)
app.js
src/controllers/docker.controller.js

diff --git a/app.js b/app.js
index 9058e778c84c094c4de455373616a613bb796889..75033551c4d7ebfea13c5cf26c399c4764ee6e1f 100755 (executable)
--- 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( {
index 4cd990b0677105563520bdd647520ea6c7aea620..f9b42effb1f38b7998806f395be0cea627172514 100644 (file)
@@ -1,6 +1,4 @@
 const { Client } = require( 'ssh2' );
-const Docker = require('dockerode');
-const docker = new Docker();
 
 module.exports = {
   stopContainer:async ( req, res, next ) => {