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 # 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 CMD ["python", "app.py"]