File size: 1,547 Bytes
556476f
 
 
29f1043
 
 
 
 
 
 
 
556476f
29f1043
 
9773321
29f1043
 
9773321
044fb3f
989aa4d
 
 
044fb3f
 
 
 
 
 
 
29f1043
980d9ed
29f1043
 
044fb3f
556476f
 
 
989aa4d
 
 
 
 
 
556476f
 
 
 
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
44
45
46
47
FROM python:3.9

#COPY requirements.txt /app/
WORKDIR /app
# # Set up a new user named "user" with user ID 1000
# RUN useradd -m -u 1000 user
# # Switch to the "user" user
# USER user
# # Set home to the user's home directory
# ENV HOME=/home/user \
# 	PATH=/home/user/.local/bin:$PATH

# # Set the working directory to the user's home directory
# WORKDIR $HOME/app

# # Copy the current directory contents into the container at $HOME/app setting the owner to the user
# COPY --chown=user . $HOME/app

RUN --mount=type=secret,id=LICENSE_KEY,mode=0444,required=true \
    python -m venv venv \
    && source venv/bin/activate \
    && pip install --upgrade pip \
    && pip install prodigy -f https://$(cat /run/secrets/LICENSE_KEY)@download.prodi.gy
#    && pip install --trusted-host pypi.python.org -r requirements.txt
# COPY wheel/prodigy-xxx-linux_x86_64.whl ./wheel/
# RUN pip install wheel/prodigy-xxx-linux_x86_64.whl \
#     && rm -rf wheel/prodigy-xxx-linux_x86_64.whl
RUN python -m spacy download en_core_web_sm

RUN chmod 777 .

COPY prodigy.json .
COPY data ./data/

ENV PRODIGY_HOME /app
ENV PRODIGY_LOGGING "verbose"
ENV PRODIGY_ALLOWED_SESSIONS "user1,user2"

RUN --mount=type=secret,id=AUTH_USER,mode=0444,required=true \
    ENV PRODIGY_BASIC_AUTH_USER $(cat /run/secrets/AUTH_USER)

RUN --mount=type=secret,id=AUTH_PASS,mode=0444,required=true \   
    ENV PRODIGY_BASIC_AUTH_PASS $(cat /run/secrets/AUTH_PASS)

EXPOSE 7860

CMD python -m prodigy ner.manual ner_news en_core_web_sm ./data/dataset.jsonl --label PERSON,ORG,PRODUCT