Diet_Planning / Dockerfile
dschandra's picture
Update Dockerfile
68169e2 verified
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"]