File size: 941 Bytes
f7afa35
 
 
 
 
43dfddb
 
b7a96ac
be33b14
30122c4
 
 
 
f7afa35
 
be33b14
30122c4
 
 
43dfddb
30122c4
43dfddb
30122c4
f7afa35
 
 
 
43dfddb
f7afa35
b7a96ac
 
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
FROM python:3.12.0
# RUN apt-get update && apt-get install -y \
#     sqlite3 \
#     libsqlite3-dev \
#     && rm -rf /var/lib/apt/lists/*
COPY requirements.txt /app/requirements.txt
WORKDIR /app
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt
RUN playwright install-deps 
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH
    
WORKDIR /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 curl https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_amd64 -o frpc_linux_amd64_v0.2
USER root
RUN mv frpc_linux_amd64_v0.2 /usr/local/lib/python3.12/site-packages/gradio/
RUN chmod +x /usr/local/lib/python3.12/site-packages/gradio/frpc_linux_amd64_v0.2
EXPOSE 7860
USER user
# CMD ["python", "main.py"]
CMD ["gradio", "main.py"]