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 344e1b9 commit 0a5eb29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion 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 @@ -59,7 +60,8 @@ export class DockerContainerPool implements OnApplicationBootstrap {
HostConfig: {
Memory: (1024 * 1024 * 1024) / 2, // 1GB 메모리 제한
MemorySwap: (1024 * 1024 * 1024) / 2 // swap 메모리도 1GB로 설정
}
},
network: 'froxy-network'
});
container.start();
this.pool.push(container);
Expand Down

0 comments on commit 0a5eb29

Please sign in to comment.