File size: 784 Bytes
d0fda5a
 
 
 
 
 
 
 
 
 
 
 
 
 
0477191
d0fda5a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0477191
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
29
30
31
32
33
FROM python:3.12-slim

ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PORT=7860

RUN apt-get update && apt-get install -y --no-install-recommends \
        build-essential libgomp1 \
    && rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

WORKDIR /app

RUN pip install --no-cache-dir "poetry==1.8.3" && poetry --version

COPY --chown=user pyproject.toml poetry.lock* /app/

RUN poetry config virtualenvs.create true \
 && poetry config virtualenvs.in-project true \
 && poetry install --no-interaction --no-ansi --only main

ENV PATH="/app/.venv/bin:$PATH"

COPY --chown=user src /app/src

EXPOSE 7860

CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "7860"]