-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile_cpu
More file actions
38 lines (28 loc) · 1005 Bytes
/
Dockerfile_cpu
File metadata and controls
38 lines (28 loc) · 1005 Bytes
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
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y \
software-properties-common libgl1-mesa-glx apt-utils
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update && apt-get install -y python3.8 python3-pip
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
RUN apt-get install --no-install-recommends -y openjdk-11-jre-headless
RUN apt-get -y install cron
# set work directory
WORKDIR /
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
# set display port to avoid crash
ENV DISPLAY=:99
# Upgrade pip
RUN python3 -m pip install --upgrade pip
# copy project
COPY requirements.txt requirements.txt
COPY config.properties config.properties
# install dependencies
RUN python3 -m pip install -r requirements.txt
# Expose ports
EXPOSE 8080
CMD torchserve --start --ncs --ts-config config.properties --model-store onnx/ \
--models onnx/general_topic_classifier.mar && tail -f /dev/null