feat: disable global network in player containers

This commit is contained in:
Lin, Hung-Shin authored and wancat committed 2023-10-30 21:28:10 +08:00
1 parent f8254b55c9
commit 7843020524
2 files changed
+3 -2

No files matched your search

+1
View File
@@ -93,3 +93,4 @@ networks:
internal:
players:
name: linux-odyssey-players
internal: true
+2 -2
View File
@@ -12,6 +12,7 @@ const containerOptions = {
OpenStdin: true,
StdinOnce: false,
HostConfig: {
NetworkMode: config.dockerNetwork,
Binds:
!config.isProduction && config.hostPwd
? [
@@ -22,14 +23,13 @@ const containerOptions = {
},
}
const network = engine.getNetwork(config.dockerNetwork)
// const network = engine.getNetwork(config.dockerNetwork)
export async function createContainer(name) {
const container = await engine.createContainer({
...containerOptions,
name,
})
await network.connect({ Container: container.id })
return container
}