|
FROM python:3.12 |
|
|
|
RUN apt-get update && apt-get install -y \ |
|
wget \ |
|
gnupg \ |
|
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ |
|
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ |
|
&& apt-get update && apt-get install -y \ |
|
google-chrome-stable \ |
|
fonts-ipafont-gothic \ |
|
fonts-wqy-zenhei \ |
|
fonts-thai-tlwg \ |
|
fonts-khmeros \ |
|
fonts-freefont-ttf \ |
|
libxss1 \ |
|
--no-install-recommends \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN google-chrome --version |
|
RUN useradd -m -u 1000 user |
|
USER user |
|
ENV PATH="/home/user/.local/bin:$PATH" |
|
|
|
WORKDIR /app |
|
|
|
COPY --chown=user ./requirements.txt requirements.txt |
|
RUN pip install --no-cache-dir --upgrade -r requirements.txt |
|
|
|
COPY --chown=user . /app |
|
EXPOSE 7860 |
|
|
|
CMD ["sh", "-c", "python app.py"] |