Skip to content

Commit 25f9b64

Browse files
authored
Merge pull request #10 from DMU-DebugVisual/refactor/dirs_and_version
Refactor: aws 서버 디렉토리명 변경으로 인한 수정, fix: Dockerfile 베이스 이미지 EOL(지원 종료) 문제 해결
2 parents 6d0d385 + cab12ca commit 25f9b64

File tree

8 files changed

+65
-18
lines changed

8 files changed

+65
-18
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 컴파일러 임시 파일들
22
server/code/*
33
!server/code/.gitkeep
4+
.github/*
45
.env

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-slim-buster
1+
FROM python:3.9-slim-bookworm
22

33
WORKDIR /usr/src/app
44

docker-compose.yml

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,69 @@
1+
# 서버 루트 파일에 들어가 있는 docker-compose.yml
2+
# flask-server 컨테이너에 들어가있는 거 X
3+
14
services:
25
backend:
3-
build: .
6+
build:
7+
context: ./Zivorp_Backend
8+
dockerfile: Dockerfile
9+
container_name: spring-backend
10+
working_dir: /app
411
ports:
512
- "8080:8080"
13+
networks:
14+
- debug-net
615
depends_on:
716
- flask
8-
environment:
9-
SPRING_DATASOURCE_URL: jdbc:mysql://db:3306/debugdb
10-
SPRING_DATASOURCE_USERNAME: root
11-
SPRING_DATASOURCE_PASSWORD: hmjeoung33
1217

1318
flask:
1419
build:
15-
context: ./flask # Flask Dockerfile 위치
16-
container_name: python-compiler
20+
context: ./Zivorp_Spike
21+
dockerfile: Dockerfile
22+
container_name: flask-server
1723
ports:
1824
- "5050:5050"
25+
volumes:
26+
- /home/ec2-user/Zivorp_Spike/server/code:/usr/src/app/code
27+
- /var/run/docker.sock:/var/run/docker.sock
28+
networks:
29+
- debug-net
30+
dns:
31+
- 8.8.8.8
32+
- 8.8.4.4
33+
environment:
34+
- PYTHONIOENCODING=utf-8
35+
- LANG=C.UTF-8
36+
- LC_ALL=C.UTF-8
37+
env_file:
38+
- ./Zivorp_Spike/.env
1939

20-
db:
21-
image: mysql:8.0
22-
ports:
23-
- "3306:3306"
40+
python-compiler:
41+
build:
42+
context: ./Zivorp_Spike/docker/python
43+
image: python-compiler
44+
container_name: python-compiler
45+
entrypoint: [ "echo", "python-compiler image build only" ]
46+
networks:
47+
- debug-net
48+
49+
c-compiler:
50+
build:
51+
context: ./Zivorp_Spike/docker/c
52+
image: c-compiler
53+
container_name: c-compiler
54+
entrypoint: [ "echo", "c-compiler image build only" ]
55+
networks:
56+
- debug-net
57+
58+
java-compiler:
59+
build:
60+
context: ./Zivorp_Spike/docker/java
61+
image: java-compiler
62+
container_name: java-compiler
63+
entrypoint: [ "echo", "java-compiler image build only" ]
64+
networks:
65+
- debug-net
66+
67+
networks:
68+
debug-net:
69+
driver: bridge

docker/c/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ cat runtime_error.txt || echo "⚠️ runtime_error.txt 없음"
3030
echo
3131

3232
rm -f program output.txt compile_error.txt runtime_error.txt
33-
exit $status
33+
exit $status

docker/java/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:17
1+
FROM openjdk:17-jdk-slim
22
WORKDIR /usr/src/app
33

44
COPY entrypoint.sh /usr/src/app/entrypoint.sh

docker/java/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ cat runtime_error.txt || echo "⚠️ runtime_error.txt 없음"
3030
echo
3131

3232
rm -f Main.class output.txt compile_error.txt runtime_error.txt
33-
exit $status
33+
exit $status

docker/python/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM python:3.11-slim
1+
FROM python:3.9-slim-bookworm
22

33
WORKDIR /usr/src/app
44

55
COPY entrypoint.sh /usr/src/app/entrypoint.sh
66

77
RUN chmod +x /usr/src/app/entrypoint.sh
88

9-
CMD ["bash", "/usr/src/app/entrypoint.sh"]
9+
CMD ["bash", "/usr/src/app/entrypoint.sh"]

server/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def echo():
5757

5858
# 공통 코드 실행 함수
5959
def execute_code(code, input_data, lang):
60-
base_dir = '/home/ec2-user/DebugVisual_Spike/server/code'
60+
base_dir = '/home/ec2-user/Zivorp_Spike/server/code'
6161
flask_dir = '/usr/src/app/code'
6262
os.makedirs(base_dir, exist_ok=True)
6363

0 commit comments

Comments
 (0)