File size: 601 Bytes
2cd25ac
4c5156b
baae909
 
 
0eda64e
4c5156b
baae909
190d059
 
baae909
 
4c5156b
3b69f06
422b36c
4c5156b
0eda64e
 
 
baae909
 
190d059
baae909
4c5156b
 
8c03fec
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
FROM python:3.10.0-slim

# Set up the environment
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV HF_HOME=/app/.cache

# Install dependencies
RUN pip install --upgrade pip

# Create and set working directory
WORKDIR /app

# Copy the application code
COPY . /app

# Create a cache directory with appropriate permissions
RUN mkdir -p /app/.cache && chown -R 1000:1000 /app/.cache

# Install the dependencies
RUN pip install -r requirements.txt

# Expose the port and define the entrypoint
EXPOSE 7860

CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "2", "--timeout", "120", "app:app"]