Improve docker deployment configuration (#163)
This commit is contained in:
parent
a51acb9db4
commit
dae394050e
4 changed files with 12 additions and 22 deletions
|
|
@ -1,4 +1,6 @@
|
|||
models/
|
||||
loras/
|
||||
.ruff_cache/
|
||||
**/__pycache__/
|
||||
**/__pycache__/
|
||||
config.yml
|
||||
api_tokens.yml
|
||||
|
|
@ -1,12 +1,5 @@
|
|||
# Use an official CUDA runtime with Ubuntu as a parent image
|
||||
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04
|
||||
|
||||
ARG GIT_REPO=https://github.com/theroyallab/tabbyAPI
|
||||
ARG DO_PULL=true
|
||||
ENV DO_PULL $DO_PULL
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /app
|
||||
FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
|
|
@ -15,20 +8,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||
ca-certificates \
|
||||
python3.11 \
|
||||
python3-pip \
|
||||
git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Update repo
|
||||
RUN if [ ${DO_PULL} ]; then \
|
||||
git init && \
|
||||
git remote add origin $GIT_REPO && \
|
||||
git fetch origin && \
|
||||
git pull origin main && \
|
||||
echo "Pull finished"; fi
|
||||
|
||||
# Upgrade pip
|
||||
RUN pip3 install --no-cache-dir --upgrade pip
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /app
|
||||
|
||||
# Get requirements
|
||||
COPY pyproject.toml .
|
||||
|
||||
|
|
@ -38,9 +25,6 @@ RUN pip3 install --no-cache-dir .[cu121]
|
|||
# Copy the current directory contents into the container
|
||||
COPY . .
|
||||
|
||||
# Create a config.yml
|
||||
COPY config_sample.yml config.yml
|
||||
|
||||
# Make port 5000 available to the world outside this container
|
||||
EXPOSE 5000
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@ services:
|
|||
- NAME=TabbyAPI
|
||||
- NVIDIA_VISIBLE_DEVICES=all
|
||||
volumes:
|
||||
- ./models:/app/models
|
||||
# - /path/to/models:/app/models # Change me
|
||||
# - /path/to/config.yml:/app/config.yml # Change me
|
||||
# - /path/to/api_tokens.yml:/app/api_tokens.yml # Change me
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue