File size: 1,344 Bytes
cecd57a
 
e7cf806
cecd57a
e7cf806
 
cecd57a
 
 
0c8234a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cecd57a
 
 
 
 
 
 
 
 
 
 
 
 
 
0c8234a
 
 
 
 
 
 
 
 
 
 
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Use official Python 3.9 image
FROM python:3.9

# Set working directory to /app (root of the repository)
WORKDIR /app

# Copy requirements file
COPY ./requirements.txt /app/requirements.txt

# Install dependencies including logging
RUN pip install --no-cache-dir --upgrade -r requirements.txt loguru

# Copy the entire project
COPY . /app

# Run as non-root user (required by Hugging Face)# Use official Python 3.9 image
FROM python:3.9

# Set working directory to /app (root of the repository)
WORKDIR /app

# Copy requirements file
COPY ./requirements.txt /app/requirements.txt

# Install dependencies including logging
RUN pip install --no-cache-dir --upgrade -r requirements.txt loguru

# Copy the entire project
COPY . /app

# Run as non-root user (required by Hugging Face)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Expose port
EXPOSE 7860

# Command to run the app, adjusting for the app/ subdirectory
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--log-level", "debug"]
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Expose port
EXPOSE 7860

# Command to run the app, adjusting for the app/ subdirectory
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--log-level", "debug"]