# 적재(ingest.py)와 dbt build를 한 번 돌리고 끝나는 배치 작업 이미지.
# 이 교안에서는 직접 빌드하지 않았습니다(실습 환경에 Docker가 없음). 파일 구조와 명령은 공식 문서 기준입니다.
FROM python:3.13-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY ingest.py ./
COPY shop_dbt/ ./shop_dbt/
# 비밀번호·토큰은 이미지에 넣지 않고 실행할 때 환경 변수로 받습니다
ENV DBT_PROFILES_DIR=/app/shop_dbt
CMD ["sh", "-c", "python ingest.py && cd shop_dbt && dbt build"]
