Skip to content

Commit

Permalink
fix(#151): dind
Browse files Browse the repository at this point in the history
  • Loading branch information
mjh000526 committed Dec 3, 2024
1 parent e685792 commit 344e1b9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions apps/backend/src/config/typeorm.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const typeORMConfig = async (configService: ConfigService): Promise<TypeO
username: configService.get<string>('MYSQL_USER'),
password: configService.get<string>('MYSQL_PASSWORD'),
database: configService.get<string>('MYSQL_DATABASE'),
entities: [User, Lotus, Comment, Tag, History, LotusTag],
dropSchema: true,
synchronize: true //todo: env로 release에서는 false가 되도록 해야함
entities: [User, Lotus, Comment, Tag, History, LotusTag]
//synchronize: true //todo: env로 release에서는 false가 되도록 해야함
});
4 changes: 2 additions & 2 deletions apps/backend/src/docker/docker.consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface GistFile {
attr: GistFileAttributes;
}

@Processor('docker-queue')
@Processor('always-queue')
@Injectable()
export class DockerConsumer {
queue_num = false;
Expand Down Expand Up @@ -53,7 +53,7 @@ export class DockerConsumer {
const { gitToken, gistId, commitId, mainFileName, inputs, c } = job.data;
let container;
try {
// console.log(`${c}번째 프로세스 시작`);
console.log(`${c}번째 프로세스 시작`);
container = await this.dockerContainerPool.getContainer();
const result = await this.runGistFiles(container, gitToken, gistId, commitId, mainFileName, inputs);
await this.cleanWorkDir(container);
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/docker/docker.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { GistModule } from '@/gist/gist.module';
imports: [
GistModule,
BullModule.registerQueue({
name: 'docker-queue'
name: 'always-queue'
})
],
controllers: [DockerController],
Expand Down
4 changes: 2 additions & 2 deletions apps/backend/src/docker/docker.pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class DockerContainerPool implements OnApplicationBootstrap {
const containersToDelete = await this.docker.listContainers({ all: true });
await Promise.all(
containersToDelete
.filter((container) => container.Names.some((name) => name.startsWith('/froxy-run')))
.filter((container) => container.Names.some((name) => name.startsWith('/froxy-always')))
.map(async (container) => {
const removeContainer = await this.docker.getContainer(container.Id);
await removeContainer.remove({ force: true });
Expand Down Expand Up @@ -55,7 +55,7 @@ export class DockerContainerPool implements OnApplicationBootstrap {
'NODE_DISABLE_COLORS=true', // 색상 비활성화
'TERM=dumb' // dumb 터미널로 설정하여 색상 비활성화
],
name: `froxy-run${i + 1}`,
name: `froxy-always${i + 1}`,
HostConfig: {
Memory: (1024 * 1024 * 1024) / 2, // 1GB 메모리 제한
MemorySwap: (1024 * 1024 * 1024) / 2 // swap 메모리도 1GB로 설정
Expand Down

0 comments on commit 344e1b9

Please sign in to comment.