File size: 964 Bytes
685cc58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.8

WORKDIR /code

RUN wget https://registry.npmmirror.com/-/binary/node/latest-v16.x/node-v16.13.1-linux-x64.tar.gz \
    && tar -xvf node-v16.13.1-linux-x64.tar.gz \
    && mv node-v16.13.1-linux-x64 /usr/local/nodejs \
    && ln -s /usr/local/nodejs/bin/node /usr/local/bin \
    && ln -s /usr/local/nodejs/bin/npm /usr/local/bin \
    && node -v

RUN apt-get update \
    && apt-get install -y texlive-full \
    && pdflatex -v

RUN git clone https://github.com/ImageMagick/ImageMagick.git ImageMagick-7.1.1 \
    && cd ImageMagick-7.1.1 \
    && ./configure \
    && make \
    && make install \
    && ldconfig /usr/local/lib \
    && convert --version

COPY ./requriements.txt /code/requriements.txt

RUN pip install --no-cache-dir --upgrade -r /code/requriements.txt


RUN useradd -m -u 1000 user

USER user

ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app

COPY --chown=user . $HOME/app

CMD ["python", "app.py"]