This commit is contained in:
+40
@@ -0,0 +1,40 @@
|
||||
# Intelligence Service Dockerfile
|
||||
# Python FastAPI 기반 AI 건강관리 서비스
|
||||
|
||||
FROM python:3.11-slim
|
||||
|
||||
# 작업 디렉토리 설정
|
||||
WORKDIR /app
|
||||
|
||||
# 시스템 패키지 업데이트 및 필요한 패키지 설치
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Python 의존성 파일 복사 및 설치
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir --upgrade pip
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# 애플리케이션 코드 복사
|
||||
COPY . .
|
||||
|
||||
# 비-root 사용자 생성 및 권한 설정
|
||||
RUN groupadd -r appuser && useradd -r -g appuser appuser
|
||||
RUN chown -R appuser:appuser /app
|
||||
USER appuser
|
||||
|
||||
# 헬스체크 설정
|
||||
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:8083/api/v1/health/status || exit 1
|
||||
|
||||
# 포트 노출
|
||||
EXPOSE 8083
|
||||
|
||||
# 환경변수 설정
|
||||
ENV PYTHONPATH=/app
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# 애플리케이션 실행 (프로젝트 표준 방식 사용)
|
||||
CMD ["python", "run.py"]
|
||||
Reference in New Issue
Block a user