Improve docker deployment configuration (#163)
This commit is contained in:
parent
a51acb9db4
commit
dae394050e
4 changed files with 12 additions and 22 deletions
2
api_tokens_sample.yml
Normal file
2
api_tokens_sample.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
api_key: # Insert api key here
|
||||||
|
admin_key: # Insert admin key here
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
models/
|
models/
|
||||||
loras/
|
loras/
|
||||||
.ruff_cache/
|
.ruff_cache/
|
||||||
**/__pycache__/
|
**/__pycache__/
|
||||||
|
config.yml
|
||||||
|
api_tokens.yml
|
||||||
|
|
@ -1,12 +1,5 @@
|
||||||
# Use an official CUDA runtime with Ubuntu as a parent image
|
# Use an official CUDA runtime with Ubuntu as a parent image
|
||||||
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04
|
FROM nvidia/cuda:12.1.0-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
|
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
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 \
|
ca-certificates \
|
||||||
python3.11 \
|
python3.11 \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
git \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& 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
|
# Upgrade pip
|
||||||
RUN pip3 install --no-cache-dir --upgrade pip
|
RUN pip3 install --no-cache-dir --upgrade pip
|
||||||
|
|
||||||
|
# Set the working directory in the container
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
# Get requirements
|
# Get requirements
|
||||||
COPY pyproject.toml .
|
COPY pyproject.toml .
|
||||||
|
|
||||||
|
|
@ -38,9 +25,6 @@ RUN pip3 install --no-cache-dir .[cu121]
|
||||||
# Copy the current directory contents into the container
|
# Copy the current directory contents into the container
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Create a config.yml
|
|
||||||
COPY config_sample.yml config.yml
|
|
||||||
|
|
||||||
# Make port 5000 available to the world outside this container
|
# Make port 5000 available to the world outside this container
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,9 @@ services:
|
||||||
- NAME=TabbyAPI
|
- NAME=TabbyAPI
|
||||||
- NVIDIA_VISIBLE_DEVICES=all
|
- NVIDIA_VISIBLE_DEVICES=all
|
||||||
volumes:
|
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:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
reservations:
|
reservations:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue