From 15be5f0832d812a7b11652e42e828e0fcd88ba40 Mon Sep 17 00:00:00 2001 From: "aj4941@naver.com" Date: Tue, 17 Oct 2023 19:55:24 +0900 Subject: [PATCH 1/2] =?UTF-8?q?:pencil2:=20[FIX]=20code=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EC=9D=B4=20=EC=83=9D=EC=84=B1=EB=90=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EB=8A=94=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 로컬에 파일을 저장했던 코드를 다시 수정하여 배포 서버에서 파일이 생성되게 한다. --- Dockerfile | 4 ++++ .../domain/testStart/service/TempCodeInitializer.java | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 11090805..4c925c93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,5 +3,9 @@ FROM openjdk:17-oracle ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} app.jar +COPY temp.cpp /codes/temp.cpp +COPY temp.py /codes/temp.py +COPY Main.java /codes/Main.java + ENTRYPOINT ["java","-jar","/app.jar"] diff --git a/src/main/java/swm_nm/morandi/domain/testStart/service/TempCodeInitializer.java b/src/main/java/swm_nm/morandi/domain/testStart/service/TempCodeInitializer.java index aa74437f..0194fa89 100644 --- a/src/main/java/swm_nm/morandi/domain/testStart/service/TempCodeInitializer.java +++ b/src/main/java/swm_nm/morandi/domain/testStart/service/TempCodeInitializer.java @@ -36,9 +36,9 @@ public String generateKey(Tests test, int problemNumber, String language) { @PostConstruct public void initTempCodeInitializer() { languages = List.of("Python", "Cpp", "Java"); - String pythonCode = readCodeFromFile("src/main/resources/codes/temp.py"); - String cppCode = readCodeFromFile("src/main/resources/codes/temp.cpp"); - String javaCode = readCodeFromFile("src/main/resources/codes/temp.java"); + String pythonCode = readCodeFromFile("codes/temp.py"); + String cppCode = readCodeFromFile("codes/temp.cpp"); + String javaCode = readCodeFromFile("codes/Main.java"); codeLists = List.of(pythonCode, cppCode, javaCode); } From 21e7b6fa5169da8d2594bb182812601cd86e6650 Mon Sep 17 00:00:00 2001 From: "aj4941@naver.com" Date: Tue, 17 Oct 2023 20:02:27 +0900 Subject: [PATCH 2/2] =?UTF-8?q?:pencil2:=20[FIX]=20code=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=9C=84=EC=B9=98=20=EC=88=98=EC=A0=95=EC=97=90=20?= =?UTF-8?q?=EB=94=B0=EB=A5=B8=20Dockerfile=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 7 +++---- Main.java | 11 ----------- 2 files changed, 3 insertions(+), 15 deletions(-) delete mode 100644 Main.java diff --git a/Dockerfile b/Dockerfile index 4c925c93..5f3eadbc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,8 @@ FROM openjdk:17-oracle ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} app.jar -COPY temp.cpp /codes/temp.cpp -COPY temp.py /codes/temp.py -COPY Main.java /codes/Main.java +COPY src/resources/codes/temp.cpp /codes/temp.cpp +COPY src/resources/codes/temp.py /codes/temp.py +COPY src/resources/codes/temp.java /codes/temp.java ENTRYPOINT ["java","-jar","/app.jar"] - diff --git a/Main.java b/Main.java deleted file mode 100644 index 596f9b79..00000000 --- a/Main.java +++ /dev/null @@ -1,11 +0,0 @@ -import java.util.*; -import java.lang.*; -import java.io.*; - -class Main -{ - public static void main (String[] args) - { - System.out.println("Hello World!"); - } -} \ No newline at end of file