Spaces:
Running
Running
File size: 812 Bytes
41ace70 314597a 673e857 2e63948 673e857 26e4605 9750350 314597a 26e4605 |
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 |
FROM python:3.13
RUN useradd -m -u 1000 user
# Install system dependencies
RUN apt-get update && apt-get install -y xvfb wget
# Install Google Chrome
RUN 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
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
# Start Xvfb and run the application
CMD sh -c "Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & export DISPLAY=:99 && uvicorn api:app --host 0.0.0.0 --port 7860"
|