mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-14 15:57:27 +00:00
Docker: Add var to pull on build
When building the Docker container, try pulling from the github repository to get the latest commit. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
# 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
|
||||
|
||||
@@ -14,6 +18,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
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
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ services:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: ./docker/Dockerfile
|
||||
args:
|
||||
- DO_PULL=true
|
||||
ports:
|
||||
- "5000:5000"
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user