-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (28 loc) · 975 Bytes
/
Dockerfile
File metadata and controls
38 lines (28 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Python 3.11 slim 이미지 사용 (경량화)
FROM python:3.11-slim
# 작업 디렉토리 설정
WORKDIR /app
# 시스템 패키지 업데이트 및 필수 패키지 설치
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Python 의존성 파일 복사
COPY requirements.txt .
# Python 패키지 설치
RUN pip install --no-cache-dir -r requirements.txt
# 애플리케이션 코드 복사
COPY . .
# ChromaDB 데이터 디렉토리 생성
RUN mkdir -p static/data/chatbot/chardb_embedding \
static/data/chatbot/imagedb_embedding
# 환경변수 기본값 설정
ENV FLASK_ENV=production
ENV FLASK_DEBUG=False
ENV PORT=5000
# 포트 노출
EXPOSE 5000
# 헬스체크 설정
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:5000/health')" || exit 1
# 애플리케이션 실행
CMD ["python", "app.py"]