File size: 695 Bytes
d70912d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132ace4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Use a Python 3.10 base image
FROM python:3.10-slim

# Set working directory
WORKDIR ./

# 1. First install dependencies as root
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# 2. Create non-root user and data directories
RUN useradd -m -u 1000 appuser && \
    mkdir -p /data/processed/text /data/processed/voice \
             /data/pending/text /data/pending/voice && \
    chown -R appuser:appuser /data

# 3. Switch to non-root user
USER appuser

# 4. Copy app files (now owned by appuser)
COPY --chown=appuser . .

# Change the command to use main.py instead of app.py
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]