|
|
FROM python:3.11 |
|
|
|
|
|
WORKDIR /code |
|
|
|
|
|
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" |
|
|
COPY ./requirements.txt /code/requirements.txt |
|
|
RUN python3 -m pip install --no-cache-dir --upgrade pip |
|
|
RUN python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt |
|
|
|
|
|
COPY . . |
|
|
|
|
|
CMD ["panel", "serve", "/code/app.py", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "*"] |
|
|
|
|
|
RUN mkdir /.cache |
|
|
RUN chmod 777 /.cache |
|
|
RUN mkdir .chroma |
|
|
RUN chmod 777 .chroma |