-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (23 loc) · 827 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 python:3.8-slim
WORKDIR /build
# Install required packages
RUN apt-get update && apt-get install -y sysstat git cmake g++
# Clone rocm-smi and install the package
RUN git clone https://github.com/ROCm/rocm_smi_lib
WORKDIR /build/rocm_smi_lib/build
RUN cmake .. && make -j$(nproc) && make install
# clean cloned directory
RUN rm -r /build
# link executable
RUN ln -s /opt/rocm/bin/rocm-smi /usr/local/bin/rocm-smi
# create user
WORKDIR /usr/src/app
RUN useradd -m rmanager
USER rmanager
# COPY app.py and requirements
COPY src/ .
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
ENV PATH="$PATH:/home/rmanager/.local/bin/"
# Run app.py when the container launches
CMD ["uvicorn", "app:app","--host","0.0.0.0", "--workers", "20","--log-level","info"]