Skip to content

Commit

Permalink
Update Dockerfile.cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
jonafeucht committed Oct 27, 2024
1 parent 422fce2 commit 3ee1a12
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions Dockerfile.cuda
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"]

0 comments on commit 3ee1a12

Please sign in to comment.