QRcheck / Dockerfile
Corin1998's picture
Create Dockerfile
2f6ecde verified
raw
history blame contribute delete
497 Bytes
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# 必要なツール
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libffi-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# HF Spaces は $PORT を環境変数で渡す
ENV PORT=7860
EXPOSE 7860
CMD ["sh", "-lc", "python -m uvicorn src.main:app --host 0.0.0.0 --port ${PORT}"]