-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
54 lines (45 loc) · 1.55 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
48
49
50
51
52
53
54
# Change CUDA and cuDNN version here
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu20.04
ARG PYTHON_VERSION=3.10
ENV DEBIAN_FRONTEND=noninteractive
# Install Python and dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
wget \
git \
curl \
build-essential \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update && apt-get install -y --no-install-recommends \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-venv \
python3-pip \
&& wget https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
&& python${PYTHON_VERSION} get-pip.py \
&& rm get-pip.py \
&& ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python3 \
&& ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python \
&& ln -sf /usr/bin/pip3 /usr/bin/pip \
&& python3 --version \
&& pip3 --version \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy everything from DockerFileFolder and the rest of the directory structure
COPY DockerFileFolder/ /app/DockerFileFolder/
COPY . /app
COPY requirements.txt /app/
COPY pyproject.toml /app/
# Set working directory
WORKDIR /app
# Install dependencies
RUN pip3 install --no-cache-dir -r requirements.txt
RUN pip3 install -e . --no-build-isolation
# Create log directory if it doesn't exist
RUN mkdir -p /app/src/api/logs
# Expose port
EXPOSE 8000
# Set working directory for the server
WORKDIR /app/src/api
# Command to run the server
CMD ["python3", "serve.py"]