-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
39 lines (30 loc) · 978 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# FROM python:3.12.1-slim-bookworm
FROM python:3.12.1-alpine3.19
ENV PIP_ROOT_USER_ACTION=ignore
# home for "nobody" user (e.g., caches, configs)
ENV HOME=/workspace
# gradio stuff
ARG GRADIO_SERVER_PORT=7860
ENV GRADIO_SERVER_PORT=${GRADIO_SERVER_PORT}
ENV GRADIO_NUM_PORTS=1
ENV GRADIO_SERVER_NAME="0.0.0.0"
ENV GRADIO_ANALYTICS_ENABLED=False
# whether file paths to tool config files can be set
ENV READONLY_PATHS=True
EXPOSE ${GRADIO_SERVER_PORT}
WORKDIR /workspace
# standard pip update
RUN python3 -m pip install -U pip setuptools wheel
# resources
COPY resources /workspace/resources
# install LCC-NLP tools
COPY setup.cfg setup.py pyproject.toml MANIFEST.in LICENSE /workspace/
COPY src /workspace/src
RUN python3 -m pip install .
# add gradio stuff
COPY examples/gradio /workspace/gradio
RUN python3 -m pip install -r /workspace/gradio/requirements.txt
# downgrade user
RUN chmod -R o+rw /workspace
USER nobody
CMD ["python3", "/workspace/gradio/lcc_demo.py"]