File size: 828 Bytes
6c7823c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Base Python image
FROM python:3.10-slim

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1

# Create a user to avoid root-level issues with ChromaDB
RUN adduser --disabled-password --gecos "" appuser
USER appuser

# Create working directory
WORKDIR /home/appuser/app

# Copy project files
COPY --chown=appuser:appuser . .

# Install Python dependencies
RUN pip install --upgrade pip \
 && pip install -r requirement.txt

# If using .env file, install python-dotenv and make sure app reads it
RUN pip install python-dotenv

# Expose FastAPI default port
EXPOSE 8000
# Expose Streamlit default port
EXPOSE 8501

# Start FastAPI app in the background, then Streamlit
CMD uvicorn streamlit_app.main_api:app --host 0.0.0.0 --port 8000 & \
    streamlit run streamlit_app/app.py --server.port 8501