Skip to content

Commit

Permalink
fix tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed Nov 1, 2024
1 parent b7830a2 commit 9770da5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/DockerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ export default class DockerManager {
EndpointsConfig: {
[this.networkName]: {
Aliases: [host],
// @ts-ignore
NetworkID: network.data.Id
}
}
}
})
}
// @ts-ignore
if(container.data.State != 'running'){
await container.start()
}
Expand All @@ -125,6 +127,7 @@ export default class DockerManager {
const router = this.router;
const containers = await this.docker.container.list()
for(const container of containers){
// @ts-ignore
if(container.data.Names[0].substring(1).includes(router)){
await container.stop()
await container.delete({force:true})
Expand All @@ -138,19 +141,20 @@ export default class DockerManager {
const services:Array<Service> = []
const containers = await this.docker.container.list()
for(let container of containers){
// @ts-ignore
const name = container.data.Names[0].substring(1)
if(name.includes(this.router)) continue;


// @ts-ignore
const labels = container.data.Labels;

if((labels['hypergate.EXCLUDE']||'false').toString().toLowerCase() == 'true') continue;

const containerStatus = await container.status();

// @ts-ignore
const network = containerStatus.data?.NetworkSettings?.Networks[networkName]
if(!network) continue;

// @ts-ignore
const ports = [...container.data.Ports];

const customExposedPorts = (labels['hypergate.EXPOSE']??'').split(',')
Expand All @@ -176,7 +180,7 @@ export default class DockerManager {
ports.push({ PrivatePort:privatePort, Type:proto, PublicPort:publicPort })
}
}

// @ts-ignore
const service = container.data.Ports.map((ps:any)=>{
let servicePort = ps.PrivatePort;
let serviceProto = ps.Type;
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"module": "NodeNext",
"moduleResolution": "nodenext",
"types": ["node"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
Expand Down

0 comments on commit 9770da5

Please sign in to comment.