From 4cdcc916ea965b7342a4e0b9c7ceffe95cba61c8 Mon Sep 17 00:00:00 2001 From: Yechan Lee Date: Tue, 5 Dec 2023 19:06:23 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=8F=84=EC=BB=A4=EC=84=9C=EB=B2=84=20t?= =?UTF-8?q?s=20=EB=8C=80=EC=8B=A0=20js=20=EC=93=B0=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- be/algo-with-me-docker/.dockerignore | 2 +- be/algo-with-me-docker/Dockerfile | 2 +- be/algo-with-me-docker/node-sh/run.sh | 6 +++--- be/algo-with-me-docker/package.json | 1 + be/algo-with-me-docker/src/{app.ts => app.js} | 5 ++--- 5 files changed, 8 insertions(+), 8 deletions(-) rename be/algo-with-me-docker/src/{app.ts => app.js} (91%) diff --git a/be/algo-with-me-docker/.dockerignore b/be/algo-with-me-docker/.dockerignore index 4fe7702..2762e99 100644 --- a/be/algo-with-me-docker/.dockerignore +++ b/be/algo-with-me-docker/.dockerignore @@ -1,5 +1,5 @@ node-modules/ -src/ +dist/ build.sh .eslintrc.js .prettierrc diff --git a/be/algo-with-me-docker/Dockerfile b/be/algo-with-me-docker/Dockerfile index 9f28128..c832617 100644 --- a/be/algo-with-me-docker/Dockerfile +++ b/be/algo-with-me-docker/Dockerfile @@ -21,4 +21,4 @@ SHELL ["/bin/bash", "-ec"] EXPOSE ${PORT} -CMD node dist/app.js +CMD node src/app.js diff --git a/be/algo-with-me-docker/node-sh/run.sh b/be/algo-with-me-docker/node-sh/run.sh index fc08596..5d3a6aa 100755 --- a/be/algo-with-me-docker/node-sh/run.sh +++ b/be/algo-with-me-docker/node-sh/run.sh @@ -16,16 +16,16 @@ MEMORY_FILE="/algo-with-me/submissions/$1/$2/$3.$4.memory" # 제출된 js 파일이 있으면 node로 js 파일 실행 # 주의: judge.sh와 run.sh는 execute 권한이 부여되어야 함 if [ -f "$SUBMISSION_JS_FILE" ]; then - echo "[algo-with-me] run.sh: started running $SUBMISSION_JS_FILE. COMPETITION_ID=$1, USER_ID=$2, PROBLEM_ID=$3, TESTCASE_ID=$4" + echo "[algo-with-me-docker] run.sh: started running $SUBMISSION_JS_FILE. COMPETITION_ID=$1, USER_ID=$2, PROBLEM_ID=$3, TESTCASE_ID=$4" # -o FILE Write result to FILE # -f FMT Custom format # U Total number of CPU-seconds that the process used directly (in user mode), in seconds. # e Elapsed real (wall clock) time used by the process, in seconds. # M Maximum resident set size of the process during its lifetime, in Kilobytes. /algo-with-me/node-sh/time -o "$MEMORY_FILE" -f "%M" /algo-with-me/node-sh/runJs.sh "$1" "$2" "$3" "$4" || exit 2 - echo "[algo-with-me] run.sh: successfully ran $SUBMISSION_JS_FILE. COMPETITION_ID=$1, USER_ID=$2, PROBLEM_ID=$3, TESTCASE_ID=$4" + echo "[algo-with-me-docker] run.sh: successfully ran $SUBMISSION_JS_FILE. COMPETITION_ID=$1, USER_ID=$2, PROBLEM_ID=$3, TESTCASE_ID=$4" else - echo "[algo-with-me] run.sh: cannot find submitted js file $SUBMISSION_JS_FILE" + echo "[algo-with-me-docker] run.sh: cannot find submitted js file $SUBMISSION_JS_FILE" exit 3 fi diff --git a/be/algo-with-me-docker/package.json b/be/algo-with-me-docker/package.json index 56066c9..4de86c8 100644 --- a/be/algo-with-me-docker/package.json +++ b/be/algo-with-me-docker/package.json @@ -1,4 +1,5 @@ { + "type": "commonjs", "dependencies": { "express": "^4.18.2" }, diff --git a/be/algo-with-me-docker/src/app.ts b/be/algo-with-me-docker/src/app.js similarity index 91% rename from be/algo-with-me-docker/src/app.ts rename to be/algo-with-me-docker/src/app.js index cbdeb11..36191c9 100644 --- a/be/algo-with-me-docker/src/app.ts +++ b/be/algo-with-me-docker/src/app.js @@ -1,6 +1,5 @@ -import express from 'express'; - -import child_process from 'node:child_process'; +const express = require('express'); +const child_process = require('node:child_process'); const app = express(); const PORT = 5000;