34 lines
984 B
Docker
34 lines
984 B
Docker
ARG BASE_IMAGE=vector-api-base:latest
|
|
FROM ${BASE_IMAGE}
|
|
|
|
LABEL maintainer="admin@example.com"
|
|
LABEL version="latest"
|
|
LABEL description="Vector DB API Service - Cache Problem Fixed"
|
|
|
|
# root로 전환
|
|
USER root
|
|
RUN echo "appuser:x:1000:1000:App User:/home/appuser:/bin/bash" >> /etc/passwd && \
|
|
echo "appuser:x:1000:" >> /etc/group
|
|
|
|
# appuser로 전환
|
|
USER appuser
|
|
WORKDIR /home/appuser
|
|
|
|
# 🔧 중요: pyproject.toml과 poetry.lock은 이미 Base Image에 있음
|
|
# 추가 패키지가 필요한 경우에만 설치
|
|
# RUN poetry install --only=main --no-root # ❌ 이미 설치됨
|
|
|
|
# 🚀 애플리케이션 소스 코드 복사
|
|
COPY app/ app/
|
|
|
|
# 포트 노출
|
|
EXPOSE 8000
|
|
|
|
# 헬스체크
|
|
HEALTHCHECK --interval=30s --timeout=15s --start-period=45s --retries=3 \
|
|
CMD poetry run python -c "import fastapi; print('OK')" || exit 1
|
|
|
|
# 🛠️ 디버깅용: 컨테이너를 계속 실행 상태로 유지
|
|
#CMD ["sleep", "infinity"]
|
|
CMD ["poetry", "run", "python", "app/main.py"]
|