File size: 1,134 Bytes
223aff6
 
 
 
 
566d057
223aff6
 
 
 
 
 
 
 
 
ef301e6
223aff6
 
 
 
 
 
 
 
 
 
 
 
 
2348376
0554c52
 
566d057
 
 
223aff6
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
34
35
36
# create time : 2023.1.09
# onnxruntime==1.13.1 not supported py=3.11
# FROM python:3.11.1-slim-bullseye as compile-image
FROM python:3.9.15-slim-bullseye as compile-image

ENV POETRY_VERSION=1.5.1

RUN export DEBIAN_FRONTEND=noninteractive && \
    apt-get update && \
    apt-get install cmake build-essential  -y --no-install-recommends && \
    pip install poetry==$POETRY_VERSION 



COPY ./pyproject.toml ./app/init_jptalk.py ./poetry.lock ./
RUN poetry export -f requirements.txt -o requirements.txt    && \
    python -m venv /opt/venv && \
    /opt/venv/bin/pip install --no-cache-dir -U pip && \
    /opt/venv/bin/pip install --no-cache-dir -r requirements.txt   && \
    /opt/venv/bin/python3  init_jptalk.py 

# FROM python:3.11.1-slim-bullseye as final
FROM python:3.9.15-slim-bullseye as final
EXPOSE 7860
COPY --from=compile-image /opt/venv /opt/venv
# COPY ./app/init_jptalk.py /app/init_jptalk.py
ENV TZ=Asia/Shanghai PATH="/opt/venv/bin:$PATH"
COPY ./app /app 
WORKDIR /
# use for huggingface
RUN mkdir -p /app/.model && \
    chmod 777  -R /app 



CMD ["python", "-m","app.main"]