-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
422fce2
commit 3ee1a12
Showing
1 changed file
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
FROM nvidia/cuda:12.6.2-base-ubuntu24.04 | ||
|
||
# Set up working directory | ||
WORKDIR /app | ||
COPY . /app | ||
|
||
# Install dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y python3-pip python3-venv && \ | ||
apt-get install -y --no-install-recommends python3-pip python3-venv && \ | ||
python3 -m venv /app/venv && \ | ||
/app/venv/bin/pip install --upgrade pip && \ | ||
/app/venv/bin/pip install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu124 | ||
CMD ["/app/venv/bin/python", "-m", "fastapi", "run", "main.py", "--proxy-headers", "--host", "0.0.0.0", "--port", "8000"] | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy requirements first for caching | ||
COPY requirements.txt /app/requirements.txt | ||
RUN /app/venv/bin/pip install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu124 | ||
|
||
# Copy the rest of the application code | ||
COPY . /app | ||
|
||
# Set entrypoint | ||
CMD ["/app/venv/bin/python", "-m", "fastapi", "run", "main.py", "--proxy-headers", "--host", "0.0.0.0", "--port", "8000"] |