File size: 1,000 Bytes
e16ec3c
 
fee7e00
b49a99c
e16ec3c
 
 
fee7e00
e16ec3c
 
a7ce855
b49a99c
e16ec3c
 
 
38df9e1
e16ec3c
b49a99c
c929efe
c6775a1
e16ec3c
b49a99c
 
 
 
 
38fe66f
b49a99c
 
2bf1180
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Use a base image with Python
# Use a CUDA devel image as the base
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04

# Install git and other build tools
# The specific command depends on the base image's package manager.
# For Debian/Ubuntu-based images like python:3.10-slim, it's apt-get.
RUN apt-get update && apt-get install -y python3 python3-pip git
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install --upgrade pip


# Set the working directory in the container
ENV CUDA_HOME=/usr/local/cuda
WORKDIR /app

# Copy the requirements file and install dependencies
COPY requirements.txt .
RUN pip install torch==2.1.0
RUN pip install --no-cache-dir --upgrade setuptools wheel 
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of your application code
COPY . .

# Expose the port your application will run on
EXPOSE 7860

# Command to run your application using Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]