File size: 765 Bytes
895bd1b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b1d9c58
 
895bd1b
b1d9c58
 
895bd1b
 
 
 
 
 
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
31
# Use Python 3.10 slim as base image
FROM python:3.10-slim

# Set the working directory
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install dependencies
RUN apt-get update && apt-get install -y \
    python3-pip \
    git

# Install pip packages without caching
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121
RUN pip install --no-cache-dir -r requirements.txt

# # Copy .env file to the working directory
# COPY .env /app/.env

# # Set environment variables from .env file
# ENV $(cat /app/.env | xargs)

# Expose port 7860
EXPOSE 7860

# Run the application
CMD ["python", "app.py"]