File size: 1,052 Bytes
43dfddb
 
 
 
60e5026
 
7a89c8b
60e5026
7a89c8b
30122c4
 
 
 
 
 
be33b14
30122c4
 
 
43dfddb
30122c4
43dfddb
30122c4
1bb9119
c2f7d4d
51adffe
c2f7d4d
 
 
bdbc7f2
5ac205b
 
43dfddb
 
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
FROM python
COPY requirements.txt /app/requirements.txt
WORKDIR /app
RUN pip install -r requirements.txt
RUN playwright install-deps
RUN --mount=type=secret,id=HF_EMAIL,mode=0444,required=true \
   cat /run/secrets/HF_EMAIL
RUN --mount=type=secret,id=HF_PASS,mode=0444,required=true \
    cat /run/secrets/HF_PASS
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app
RUN playwright install

COPY --chown=user . $HOME/app
WORKDIR $HOME/app/pragetx_scraper
RUN scrapy crawl pages && \
    cd $HOME/app && \
    python setup.py
WORKDIR $HOME/app
RUN --mount=type=secret,id=HF_EMAIL,mode=0444,required=true \
    echo "HF_EMAIL=\"$(cat /run/secrets/HF_EMAIL)\"" > $HOME/app/.env &&\
    cat $HOME/app/.env
RUN --mount=type=secret,id=HF_PASS,mode=0444,required=true \
     echo "HF_PASS=\"$(cat /run/secrets/HF_PASS)\"" >> $HOME/app/.env &&\
     cat $HOME/app/.env
RUN chown user:user $HOME/app/.env
RUN chmod 666 $HOME/app/.env
RUN ls -la $HOME/app/.env
EXPOSE 7860
CMD ["python", "main.py"]