Spaces:
Sleeping
Sleeping
File size: 1,031 Bytes
31a6740 68169e2 31a6740 68169e2 31a6740 68169e2 31a6740 68169e2 31a6740 68169e2 31a6740 68169e2 31a6740 68169e2 |
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 41 42 43 |
FROM python:3.10
# Install fakeroot and set up user
RUN apt-get update && apt-get install -y fakeroot && \
mv /usr/bin/apt-get /usr/bin/.apt-get && \
echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get "$@"' > /usr/bin/apt-get && \
chmod +x /usr/bin/apt-get && \
rm -rf /var/lib/apt/lists/* && \
useradd -m -u 1000 user
# Copy root filesystem
COPY --chown=1000:1000 --from=root / /
# Set workdir
WORKDIR /home/user/app
# Install dependencies (replacing deprecated libgl1-mesa-glx)
RUN apt-get update && apt-get install -y \
git \
git-lfs \
ffmpeg \
libsm6 \
libxext6 \
cmake \
rsync \
libgl1 \
libglx-mesa0 \
&& rm -rf /var/lib/apt/lists/* \
&& git lfs install
# Copy application code
COPY --chown=1000:1000 ./app /home/user/app
# Install Python dependencies
COPY --chown=1000:1000 requirements.txt /home/user/app/
RUN pip install --no-cache-dir -r requirements.txt
# Run as non-root user
USER user
# Start the app
CMD ["python", "optimized_diet_plan_complete.py"]
|