File size: 744 Bytes
d75b820
 
c4eebf3
 
f52ae75
 
 
 
 
 
 
d75b820
f52ae75
d75b820
 
 
 
 
 
1a1e448
4d163d0
288d5ce
221f4db
f52ae75
221f4db
d75b820
339d730
d75b820
 
f52ae75
d75b820
 
 
5e9b3af
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
FROM python:3.13-slim

RUN apt-get update && apt-get install -y build-essential

RUN useradd -m -u 1000 user

USER user

ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Set the working directory
WORKDIR $HOME/app

# Update pip to the latest version
RUN pip install --upgrade pip

RUN pip install -U setuptools wheel

# Install torch cpu version
RUN pip install -U torch torchvision torchaudio

# Copy the requirements file into the container
COPY --chown=user requirements.txt .

# Install the dependencies
RUN pip install -U --no-cache-dir -r requirements.txt

# Copy the rest of the application code into the container
COPY --chown=user . .

EXPOSE 7860

ENTRYPOINT ["fastapi", "run", "main.py", "--host=0.0.0.0", "--port=7860"]