File size: 689 Bytes
95f82d0
 
0151d8f
 
 
 
3edb836
8bde49a
 
95f82d0
0151d8f
 
 
 
95f82d0
 
0151d8f
 
95f82d0
0151d8f
 
95f82d0
0151d8f
f21508a
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
FROM python:3.10-slim

# Create a non-root user
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    DEMO_MODE=true \
    OPENAI_MODEL_FILTER=gpt-4o-mini

WORKDIR $HOME/app

# Copy requirements first to leverage Docker cache
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application with proper ownership
COPY --chown=user . $HOME/app

# Create the data directory explicitly and ensure it is writable
RUN mkdir -p $HOME/app/data/demo_guests && chmod -R 777 $HOME/app/data

EXPOSE 7860
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--threads", "4", "--timeout", "120", "app:app"]