Skip to content

Commit

Permalink
fix: 도커서버 ts 대신 js 쓰도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
yechan2468 committed Dec 5, 2023
1 parent 5f82e9f commit 4cdcc91
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion be/algo-with-me-docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node-modules/
src/
dist/
build.sh
.eslintrc.js
.prettierrc
Expand Down
2 changes: 1 addition & 1 deletion be/algo-with-me-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ SHELL ["/bin/bash", "-ec"]

EXPOSE ${PORT}

CMD node dist/app.js
CMD node src/app.js
6 changes: 3 additions & 3 deletions be/algo-with-me-docker/node-sh/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions be/algo-with-me-docker/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"type": "commonjs",
"dependencies": {
"express": "^4.18.2"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 4cdcc91

Please sign in to comment.