File size: 698 Bytes
080bd23
efe31f8
29599b7
8572c92
0812cca
c29d787
0812cca
c29d787
 
 
fde91a4
 
4ad60ef
fde91a4
c29d787
fde91a4
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM python:3.10

USER root

RUN chmod 1777 /tmp \
    && apt update -q && apt install -y ca-certificates wget libgl1 \
    && wget -qO /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
    && dpkg -i /tmp/cuda-keyring.deb && apt update -q \
    && apt install -y --no-install-recommends libcudnn8 libcublas-12-2

# Install FastAPI and other Python dependencies
RUN pip install fastapi[all] uvicorn

# Copy application code
COPY main.py main.py

# Run Python script to check for errors before starting FastAPI
RUN python main.py  

# Start FastAPI server
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]