-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
27 lines (22 loc) · 1.04 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
# ------------------------------------------------------------------------------
# Base image
# ------------------------------------------------------------------------------
FROM python:3.8-slim AS base
# ------------------------------------------------------------------------------
# Install dependencies
# ------------------------------------------------------------------------------
FROM base AS deps
COPY requirements.txt ./
RUN apt update > /dev/null && \
apt install -y build-essential && \
apt-get -y install libgl1-mesa-glx && \
pip install --disable-pip-version-check -r requirements.txt && \
pip install --disable-pip-version-check torch torchvision torchaudio -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
# ------------------------------------------------------------------------------
# Final image
# ------------------------------------------------------------------------------
FROM deps
WORKDIR /usr/src/app
COPY . /usr/src/app
EXPOSE 80
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]