generated from openziti/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
23 lines (19 loc) · 942 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# PyTorch supports <= 3.7.9
FROM python:3.7.9
RUN mkdir -p /app \
&& chown -R 65534:65534 /app
COPY ./requirements.txt /app/
RUN pip install --upgrade pip \
&& pip install --no-cache-dir --requirement /app/requirements.txt \
&& rm -rf /root/.cache/pip
# provide a named volume here to accelerate startup, writeable by "nobody" too if you want the app to be able to update
# the cache, e.g. ❯ docker run --user root --entrypoint='' --rm --volume models:/app/models busybox chown -Rc 65534:65534 /app/models
ENV TRANSFORMERS_CACHE=/app/models
# Ziti C-SDK log level INFO
ENV ZITI_LOG=3
COPY ./ziti-classifier-api.py /app/
WORKDIR /app
USER nobody
# requires two positional params: Ziti identity JSON file to load context from, and the Ziti service name to host, e.g.:
# python ./ziti-classifier-api.py /opt/openziti/etc/identities/oobabooga-server.json classifier-service
ENTRYPOINT [ "python", "/app/ziti-classifier-api.py" ]