File size: 607 Bytes
e60fb94
 
 
 
 
 
 
 
 
 
 
 
 
 
0d48ff6
 
 
 
06af336
e60fb94
 
 
 
 
 
 
 
 
 
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
FROM python:3.9-slim

WORKDIR /app

# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application files
COPY . .

# Create necessary directories
RUN mkdir -p flask_session

# Set permissions for flask_session directory and touch API key file
RUN chmod -R 777 flask_session && \
    touch api_key.txt && \
    chmod 666 api_key.txt

# Set environment variables
ENV FLASK_APP=app.py
ENV FLASK_ENV=production
ENV PORT=7860

# Expose the port Hugging Face Spaces uses
EXPOSE 7860

# Command to run the application
CMD gunicorn --bind 0.0.0.0:7860 app:app