-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
63 lines (45 loc) · 1.74 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 1.2.1 is the current docker frontend that both buildkitd and kaniko supports.
# syntax = docker/dockerfile:1.2.1
#
# ===========================================
#
# THIS IS A GENERATED DOCKERFILE. DO NOT EDIT
#
# ===========================================
# Block SETUP_BENTO_BASE_IMAGE
FROM python:3.10-slim as base-debian
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV PYTHONIOENCODING=UTF-8
ENV PYTHONUNBUFFERED=1
USER root
ENV DEBIAN_FRONTEND=noninteractive
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/lib/apt \
--mount=type=cache,target=/var/cache/apt \
apt-get update -y \
&& apt-get install -q -y --no-install-recommends --allow-remove-essential ca-certificates gnupg2 bash build-essential
# Block SETUP_BENTO_USER
ARG BENTO_USER=bentoml
ARG BENTO_USER_UID=1034
ARG BENTO_USER_GID=1034
RUN groupadd -g $BENTO_USER_GID -o $BENTO_USER && useradd -m -u $BENTO_USER_UID -g $BENTO_USER_GID -o -r $BENTO_USER
SHELL [ "/bin/bash", "-eo", "pipefail", "-c" ]
ARG BENTO_PATH=/home/bentoml/bento
ENV BENTO_PATH=$BENTO_PATH
ENV BENTOML_HOME=/home/bentoml/
RUN mkdir $BENTO_PATH && chown bentoml:bentoml $BENTO_PATH -R
WORKDIR $BENTO_PATH
COPY --chown=bentoml:bentoml . ./
# Block SETUP_BENTO_COMPONENTS
# install python packages with install.sh
RUN --mount=type=cache,target=/root/.cache/pip bash -euxo pipefail /home/bentoml/bento/env/python/install.sh
# Block SETUP_BENTO_ENTRYPOINT
RUN rm -rf /var/lib/{apt,cache,log}
# Default port for BentoServer
EXPOSE 3000
# Expose Prometheus port
EXPOSE 3001
RUN chmod +x /home/bentoml/bento/env/docker/entrypoint.sh
USER bentoml
ENTRYPOINT [ "/home/bentoml/bento/env/docker/entrypoint.sh" ]