wip: connect container through ssh

This commit is contained in:
Justin Lin committed 2024-10-10 20:54:42 +08:00
1 parent 08e9191c4b
commit 19897e607f
4 files changed
+73 -12

No files matched your search

+1
View File
@@ -40,6 +40,7 @@
"passport-jwt": "^4.0.1",
"passport-local": "^1.0.0",
"socket.io": "^4.7.1",
"ssh2": "^1.16.0",
"swagger-ui-express": "^5.0.0",
"validator": "^13.11.0",
"winston": "^3.11.0",
+16 -6
View File
@@ -5,14 +5,24 @@ import logger from '../utils/logger.js'
const engine = new Docker()
const containerOptions = {
AttachStdin: true,
AttachStdout: true,
AttachStderr: true,
Tty: true,
OpenStdin: true,
StdinOnce: false,
// AttachStdin: true,
// AttachStdout: true,
// AttachStderr: true,
// Tty: true,
// OpenStdin: true,
// StdinOnce: false,
HostConfig: {
NetworkMode: config.docker.network,
PortBindings: {
'22/tcp': [
{
HostPort: '11122', // random port
},
],
},
},
ExposedPorts: {
'22/tcp': {},
},
} as Docker.ContainerCreateOptions