# Use an official Python runtime as a parent image | |
FROM python:3.9 | |
# Install git | |
RUN apt-get update && \ | |
apt-get install -y git | |
# Clone the repository | |
RUN git clone https://github.com/oobabooga/text-generation-webui.git /app | |
# Set the working directory in the container | |
WORKDIR /app | |
# Install any needed packages specified in requirements.txt | |
RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
# Run the one_click.py script to set up the environment and install dependencies | |
# Ensure that one_click.py is executable and configured to run non-interactively | |
RUN python one_click.py | |
# (Optional) Expose the port your app runs on | |
EXPOSE 7860 | |
docker build -t text-generation-webui . | |
# Command to run when starting the container | |
CMD ["python", "app/main.py"] | |