-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (20 loc) · 930 Bytes
/
Dockerfile
File metadata and controls
28 lines (20 loc) · 930 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
FROM python:3.12-slim-bookworm
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV TZ=Etc/UTC
RUN apt-get update && apt-get install -y --no-install-recommends tzdata curl && \
apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# 로컬의 app/ 디렉토리 전체를 컨테이너의 /app/app/ 디렉토리로 복사
COPY ./app ./app
RUN useradd --system --create-home appuser && \
chown -R appuser:appuser /app
USER appuser
EXPOSE 8010
# CMD 명령어는 WORKDIR (/app) 에서 실행됨.
# "app.main:app"은 /app 디렉토리 내의 'app' 패키지(즉, /app/app 디렉토리)를 찾고,
# 그 안의 'main' 모듈(즉, /app/app/main.py)에서 'app' 객체를 찾음.
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8010", "--log-level", "info", "--access-log"]