-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile_backend
43 lines (31 loc) · 1.63 KB
/
Dockerfile_backend
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
FROM nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu20.04
# suppose current folder contains these files:
# miniconda_install.sh (required): conda install file, should be python3.8
# pip.conf (optional): pip config file, if you are in China, you may need this
# Beiming-System (required): Beiming-System source code folder
# Learnware (required): Learnware source code folder
# config.json (optional): config file for a specific deployment
# swords.txt (optional): sensitive words file
COPY ./miniconda_install.sh /
RUN bash /miniconda_install.sh -b && rm /miniconda_install.sh
ENV PATH="/root/miniconda3/bin:$PATH"
RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN sed -i s@/security.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN apt-get update && apt-get install -y libffi-dev libssl-dev \
ca-certificates sqlite3 xz-utils zlib1g-dev lsb-release wget gnupg
COPY ./pip.conf* /etc/
ADD ./Beiming-System/backend/requirements.txt /
RUN sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
RUN wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | tee /etc/apt/trusted.gpg.d/postgres.asc
RUN apt-get update && apt-get install -y postgresql-client
RUN echo ${PATH}
RUN python3 -m pip install -r /requirements.txt
COPY ./Beiming-System/backend /learnware-backend/
COPY ./Learnware /learnware/
WORKDIR /learnware-backend
COPY ./config.json* /learnware-backend/
COPY ./swords.txt* /learnware-backend/swords.txt
RUN python3 -m pip install -e /learnware/
EXPOSE 8088
ENV PYTHONPATH=/learnware-backend
CMD ["python3", "scripts/main.py"]