Skip to content

Commit

Permalink
fix(#151): docker network
Browse files Browse the repository at this point in the history
  • Loading branch information
mjh000526 committed Dec 3, 2024
1 parent 4585184 commit ef7a54f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/backend/src/docker/docker.pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class DockerContainerPool implements OnApplicationBootstrap {
}

async createAlwaysContainer() {
const network = await this.docker.getNetwork('froxy-network');
for (let i = 0; i < MAX_CONTAINER_CNT; i++) {
const container = await this.docker.createContainer({
Image: 'node:latest',
Expand All @@ -58,9 +59,10 @@ export class DockerContainerPool implements OnApplicationBootstrap {
name: `froxy-always${i + 1}`,
HostConfig: {
Memory: (1024 * 1024 * 1024) / 2, // 1GB 메모리 제한
MemorySwap: (1024 * 1024 * 1024) / 2 // swap 메모리도 1GB로 설정
},
network: 'froxy-network'
MemorySwap: (1024 * 1024 * 1024) / 2, // swap 메모리도 1GB로 설정
networkMode: 'froxy-network'
}
// network: 'froxy-network'
});
container.start();
this.pool.push(container);
Expand Down

0 comments on commit ef7a54f

Please sign in to comment.