# Use Official Python image FROM python:3.9 # Set the working directory WORKDIR /text2text # Copy the requirements file into the container COPY ./requirements.txt /text2text/requirements.txt # Install the requirements RUN pip install --no-cache-dir --upgrade -r /text2text/requirements.txt # Add a new user RUN useradd -m user # Switch to the new user USER user # Set environment variables ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Set the working directory for the user WORKDIR $HOME/app # Copy the current directory contents into the container COPY --chown=user . $HOME/app # Define the command to run the application CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]