load-balancer / Dockerfile
ChandimaPrabath's picture
fix
4f7aacc
raw
history blame
913 Bytes
# Base image
FROM python:3.9
# Install additional packages and setup
RUN apt-get update && apt-get install -y \
fakeroot \
git \
git-lfs \
ffmpeg \
libsm6 \
libxext6 \
cmake \
rsync \
libgl1-mesa-glx \
&& rm -rf /var/lib/apt/lists/* \
&& 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 \
&& useradd -m -u 1000 user \
&& git lfs install
# Set the working directory
WORKDIR /home/user/app
# Copy requirements file and install dependencies
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
# Copy the application code
COPY --chown=1000:1000 ./ /home/user/app
USER user
# Expose the port the app runs on
EXPOSE 7860
# Set the entry point to run the Flask application
ENTRYPOINT ["python", "app.py"]