From e70729b0c0df12d73631e799ae86226836e9ceb4 Mon Sep 17 00:00:00 2001 From: city-unit <140349364+city-unit@users.noreply.github.com> Date: Wed, 27 Dec 2023 23:39:33 -0500 Subject: [PATCH] Update Docker Squash commit that merges #43, #44, and #45 Create .dockerignore Make compose marginally better Un-scuffed the Dockerfile --- .dockerignore | 1 + Dockerfile | 11 ++++------- docker-compose.yml | 10 ++++++++-- 3 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2bcdfd9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +models/ diff --git a/Dockerfile b/Dockerfile index c20faad..5c7e46b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,8 @@ RUN apt-get update && apt-get install -y \ # Set the working directory in the container WORKDIR /usr/src/app -# Copy the current directory contents into the container at /usr/src/app -COPY . . +# Get requirements +COPY requirements.txt requirements.txt # Install torch with CUDA support and exllamav2 RUN pip install torch --extra-index-url https://download.pytorch.org/whl/cu121 @@ -20,14 +20,11 @@ RUN pip install exllamav2 # Install any other needed packages specified in requirements.txt RUN pip install --no-cache-dir -r requirements.txt -# Copy the sample config file to the main config -RUN cp config_sample.yml config.yml +# Copy the current directory contents into the container at /usr/src/app +COPY . . # Make port 5000 available to the world outside this container EXPOSE 5000 -# Define environment variable -ENV NAME World - # Run main.py when the container launches CMD ["python3", "main.py"] diff --git a/docker-compose.yml b/docker-compose.yml index 0f6e281..0f374e3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,9 +7,15 @@ services: INSTALL_FSCHAT: "true" # Set this to "true" or "false" as needed ports: - "5000:5000" - runtime: nvidia environment: - NAME=TabbyAPI - NVIDIA_VISIBLE_DEVICES=all volumes: - - /mnt/nvme/models:/usr/src/app/models + - ./models:/usr/src/app/models + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: all + capabilities: [gpu]