-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
42 lines (32 loc) · 1.32 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
################################################################################
# getml-base
FROM python:3.11.8 AS getml-base
RUN useradd getml
USER getml
WORKDIR /home/getml
COPY --chown=getml:getml --chmod=0777 ./requirements.txt /home/getml/requirements.txt
ENV PATH="/home/getml/.local/bin:$PATH"
RUN python3.11 \
-mpip install \
-r /home/getml/requirements.txt
RUN mkdir /home/getml/.getML
################################################################################
# getml-demo
FROM getml-base AS getml-demo
ARG TARGETARCH
ARG TARGETOS
RUN \
if [ "${TARGETARCH}" = "amd64" ]; then \
export GETML_ARCH="x64" ;\
else \
export GETML_ARCH="${TARGETARCH}" ;\
fi; \
export GETML_VERSION=$(grep -oP '(?<=getml==)\d+\.\d+\.\d+' requirements.txt) ;\
export GETML_BUCKET="https://go.getml.com/static/demo/download" ;\
export GETML_ENGINE_FILE="getml-${GETML_VERSION}-${GETML_ARCH}-${TARGETOS}.tar.gz" ;\
export GETML_ENGINE_URL="${GETML_BUCKET}/${GETML_VERSION}/${GETML_ENGINE_FILE}" ;\
echo "Downloading getML engine from ${GETML_ENGINE_URL}" ;\
curl ${GETML_ENGINE_URL} | tar -C /home/getml/.getML -xvzf -
COPY --chown=getml:getml . /home/getml/demo/
EXPOSE 1709 8888
CMD [ "/home/getml/.local/bin/jupyter", "lab", "--ip='*'", "--port=8888", "--notebook-dir='/home/getml/demo'" ]