File size: 614 Bytes
2a89678
4176b8d
2a89678
 
 
 
 
 
 
 
 
 
46d794f
2a89678
 
46d794f
2a89678
 
 
 
 
 
 
 
 
 
 
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
# Use official Python image
FROM python:3.11-slim

# Create a non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Set working directory
WORKDIR /app

# Copy requirements and install
COPY --chown=user ./textModel/requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Copy the rest of the app
COPY --chown=user ./textModel/ . 

# Expose the port your Flask app will run on
EXPOSE 7860

# Command to run Flask app in Hugging Face Spaces
ENV FLASK_APP=app.py
ENV FLASK_RUN_HOST=0.0.0.0
ENV FLASK_RUN_PORT=7860

CMD ["flask", "run"]