-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (23 loc) · 940 Bytes
/
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
FROM nvidia/cuda:11.6.2-runtime-ubuntu20.04
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
RUN groupadd -r user && useradd -m --no-log-init -r -g user user
RUN apt-get -y update \
&& apt-get install -y software-properties-common \
&& apt-get -y update \
&& add-apt-repository ppa:deadsnakes/ppa
RUN apt-get -y update
RUN apt-get -y install python3.9
RUN apt-get -y install python3-pip
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN mkdir -p /opt/app /input /output \
&& chown user:user /opt/app /input /output
USER user
WORKDIR /opt/app
ENV PATH="/home/user/.local/bin:${PATH}"
ENV PYTHONPATH "${PYTHONPATH}:/opt/app/"
RUN python -m pip install --user -U pip && python -m pip install --user pip-tools
COPY ./ /opt/app/
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements_docker.txt
COPY --chown=user:user process.py /opt/app/
ENTRYPOINT [ "python", "-m", "process" ]