Spaces:
Runtime error
Runtime error
File size: 1,199 Bytes
7d82335 adb9421 cb2f301 adb9421 7688491 adb9421 7688491 adb9421 7688491 adb9421 7688491 adb9421 7688491 cb2f301 adb9421 7d82335 adb9421 dbdc55c 7d82335 4c907cc adb9421 7d82335 adb9421 86c99d6 adb9421 7d82335 964a3b7 cb2f301 adb9421 86c99d6 |
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 44 45 46 |
# Use the official Python image as the base image
FROM python:3.9
# Set the working directory to /app
WORKDIR /app
# Create a new user and switch to this user
RUN useradd -m -u 1000 user
USER user
# Set environment variables for the new user
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 at /app
COPY --chown=user . $HOME/app
# Copy requirements file
COPY ./requirements.txt ~/app/requirements.txt
# Copy poetry configuration files
COPY pyproject.toml poetry.lock /app/
# Upgrade pip and install poetry
RUN pip install --upgrade pip
RUN pip install poetry
# Install the CPU-only version of torch
RUN pip install torch==1.11.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
# Set environment variable to create a virtual environment within the project directory
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
# Lock and install project dependencies using poetry
RUN poetry lock
RUN poetry install
# Copy the rest of the application code
COPY . .
# Define the command to run the app
CMD ["poetry", "run", "chainlit", "run", "app.py", "--port", "7860"]
|