-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile_gpu
31 lines (28 loc) · 1.05 KB
/
Dockerfile_gpu
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
FROM nvidia/cuda:11.1.1-base-ubuntu18.04 as base
# first stage
FROM base as builder
WORKDIR /app
RUN apt-get update && apt-get install -y curl wget gcc build-essential git
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-4.5.12-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda
RUN /opt/conda/bin/conda create -y -n esp python=3.7
ENV PATH=/opt/conda/envs/esp/bin:$PATH
COPY requirements_gpu.txt /app
RUN pip install --no-cache-dir -r requirements_gpu.txt
COPY requirements.txt /app
RUN pip install --no-cache-dir -r requirements.txt
RUN pip uninstall -y pip
# second stage
FROM base as runner
WORKDIR /app
RUN apt-get update && apt-get install -y libsndfile1
COPY --from=builder /opt/conda/envs/esp/bin /opt/conda/envs/esp/bin
COPY --from=builder /opt/conda/envs/esp/lib /opt/conda/envs/esp/lib
ENV PATH=/opt/conda/envs/esp/bin:$PATH
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
COPY ./run.py /app
COPY ./service /app/service
CMD [ "uvicorn", "run:app", "--host", "0.0.0.0", "--port", "8000"]