-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
47 lines (38 loc) · 1.3 KB
/
Dockerfile
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
37
38
39
40
41
42
43
44
45
46
47
# Use an official Python runtime as a parent image with CUDA support
FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
# Install system dependencies
RUN apt-get update && apt-get install -y \
wget \
curl \
bzip2 \
ca-certificates \
libglib2.0-0 \
libxext6 \
libsm6 \
libxrender1 \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Python 3.12
RUN apt-get update && apt-get install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && apt-get install -y python3.12 python3.12-distutils && \
wget https://bootstrap.pypa.io/get-pip.py && \
python3.12 get-pip.py && \
rm get-pip.py
# Set Python 3.12 as the default
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
# Install pip dependencies
COPY requirements.txt .
RUN python3.12 -m pip install -r requirements.txt
# Copy the wheel file and install it
COPY dist/ai_processing-0.0.0-cp312-cp312-linux_x86_64.whl /tmp/
RUN python3.12 -m pip install /tmp/ai_processing-0.0.0-cp312-cp312-linux_x86_64.whl
# Expose the port FastAPI runs on
EXPOSE 8000
# Set the working directory
WORKDIR /app
# Command to run the server.py script
CMD ["python3.12", "server.py"]