diff --git a/be/algo-with-me-docker/.dockerignore b/be/algo-with-me-docker/.dockerignore index 4fe77028..2762e997 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 9f281285..c832617a 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 fc08596a..5d3a6aa2 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 56066c99..4de86c85 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 cbdeb11c..36191c9f 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;