aie3-autograder / Dockerfile
Dobin Yim
changed ownership
ffab2ce
raw
history blame
670 Bytes
FROM python:3.11
# Create a non-root user
RUN useradd -m -u 1000 user
# Set environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set the working directory
WORKDIR $HOME/app
# Copy requirements file and install dependencies
COPY --chown=user requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code
COPY --chown=user . .
# Ensure the user has full permissions in the working directory
RUN chown -R user:user $HOME/app && chmod -R 755 $HOME/app
# Switch to the new user
USER user
# Command to run the application
CMD ["chainlit", "run", "final.py", "--port", "7860"]