Skip to content

Commit 6edc4a9

Browse files
committed
Update Dockerfile to download model weights and add curl dependency
1 parent f66178d commit 6edc4a9

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

Dockerfile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 멀티 스테이지 빌드를 사용한 최적화된 Dockerfile
22

33
# Stage 1: 빌드 스테이지
4-
FROM python:3.10-slim as builder
4+
FROM python:3.10-slim AS builder
55

66
# 빌드 인자 정의 (기본값: CPU)
77
ARG BUILD_FOR=cpu
@@ -54,6 +54,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
5454
libxext6 \
5555
libxrender-dev \
5656
libgomp1 \
57+
curl \
5758
&& rm -rf /var/lib/apt/lists/*
5859

5960
# 비root 사용자 생성
@@ -70,13 +71,18 @@ COPY --from=builder /usr/local/bin /usr/local/bin
7071

7172
# 애플리케이션 코드 복사
7273
COPY echoshot_ai_server/ /app/echoshot_ai_server/
73-
COPY weights/ /app/weights/
7474

75-
# 모델 가중치 디렉토리 생성 (없는 경우)
76-
RUN mkdir -p /app/echoshot_ai_server/tasks/weights && \
77-
if [ -d /app/weights ]; then \
78-
cp -r /app/weights/* /app/echoshot_ai_server/tasks/weights/ 2>/dev/null || true; \
79-
fi
75+
# 모델 가중치 디렉토리 생성 및 모델 파일 다운로드
76+
RUN mkdir -p /app/weights /app/echoshot_ai_server/tasks/weights && \
77+
echo "Downloading model files..." && \
78+
curl -L -o /app/weights/FSRCNN_x2.pb \
79+
https://github.com/Saafke/FSRCNN_Tensorflow/raw/master/models/FSRCNN_x2.pb && \
80+
curl -L -o /app/weights/EDSR_x2.pb \
81+
https://github.com/Saafke/EDSR_Tensorflow/raw/master/models/EDSR_x2.pb && \
82+
curl -L -o /app/weights/RealESRGAN_x4plus.pth \
83+
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth && \
84+
cp -r /app/weights/* /app/echoshot_ai_server/tasks/weights/ && \
85+
echo "Model files downloaded successfully"
8086

8187
# 소유권 변경
8288
RUN chown -R worker:worker /app

0 commit comments

Comments
 (0)