translateTextAPI / Dockerfile
jellychoco
solve version conflict
6fb385e
raw
history blame contribute delete
641 Bytes
FROM python:3.9-slim
WORKDIR /app
# μ‹œμŠ€ν…œ νŒ¨ν‚€μ§€ μ„€μΉ˜
RUN apt-get update && apt-get install -y \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
# ν•„μš”ν•œ Python νŒ¨ν‚€μ§€ μ„€μΉ˜
COPY requirements.txt .
RUN pip install --no-cache-dir numpy==1.24.3 && \
pip install --no-cache-dir -r requirements.txt
# μ• ν”Œλ¦¬μΌ€μ΄μ…˜ μ½”λ“œ 볡사
COPY . .
# λΉ„νŠΉκΆŒ μ‚¬μš©μž 생성 및 μ „ν™˜
RUN useradd -m -u 1000 user
USER user
# ν™˜κ²½ λ³€μˆ˜ μ„€μ •
ENV PATH="/home/user/.local/bin:$PATH"
ENV PYTHONPATH="/app:$PYTHONPATH"
# μ„œλ²„ μ‹€ν–‰
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]