File size: 689 Bytes
005a292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307cacc
 
 
 
 
 
005a292
 
 
 
 
 
 
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.12-slim

WORKDIR /app

# Set environment variables.
ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PYTHONPATH=/app

# Install system dependencies.
RUN apt-get update \
 && apt-get install -y --no-install-recommends build-essential \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*

# Install Python dependencies.
COPY pyproject.toml ./
RUN pip install --no-cache-dir --upgrade pip

# Copy project files and build.
COPY src/ ./src/
RUN pip install --no-cache-dir .

# Create a non-root user and switch to it.
RUN useradd -m appuser
USER appuser

# Run the application.
CMD ["uvicorn", "src.ctp_slack_bot.api.main:app", "--host", "0.0.0.0", "--port", "8000"]