File size: 473 Bytes
f5e5bb1
08abb06
 
 
 
 
 
 
 
 
 
 
 
 
bed8371
2a97f95
bed8371
f31e9f1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM python:3.9-bullseye

RUN useradd -m user  # Creates user with home directory
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app

COPY --chown=user requirements.txt .

RUN pip install  --user -r requirements.txt

COPY --chown=user . .
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
    CMD curl --fail http://localhost:7860/test || exit 1

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