최대 1 분 소요

이제 본격적으로 도커로 배포하기 위해 Dockerfile 작성하고 리눅스용 이미지 빌드하는 실습을 해보겠다.

1. 실습 7 - Dockerfile 작성하기

Dockerfile의 Base Image:

FROM python:3.12-slim

이 한 줄이 매우 중요하다.

Windows PC에서 docker build를 실행하더라도 이 프로젝트의 최종 application image는 Linux 기반이다.

전체 흐름:

Windows Source Code
       ↓
Dockerfile
       ↓
python:3.12-slim
       ↓
Linux filesystem + Python + app
       ↓
Linux container image

API Key는 Dockerfile에 들어 있지 않다.


댓글남기기