pytorch-http/Dockerfile

24 lines
562 B
Docker
Raw Normal View History

2023-09-18 17:59:41 +00:00
FROM python:3.10-bookworm AS base
FROM base AS tini
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
FROM tini AS tools
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
export DEBIAN_FRONTEND=noninteractive \
&& apt-get update -y \
&& apt-get upgrade -y
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
FROM tools AS api
COPY . .
CMD ["python", "."]