-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathDockerfile
34 lines (25 loc) · 943 Bytes
/
Dockerfile
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
# Use Python 3.12 slim as base image
FROM python:3.12-slim
# Set working directory
WORKDIR /app
# Install build dependencies and cleanup in one layer to keep image size down
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy only pyproject.toml and other build files first
COPY pyproject.toml ./
COPY README.md ./
COPY sse_starlette ./sse_starlette
# Install package with all dependencies
RUN pip install --no-cache-dir -e .
# Install additional test dependencies if needed
# You can also add these to pyproject.toml in [project.optional-dependencies]
RUN pip install --no-cache-dir pytest pytest-asyncio httpx
# Copy test files
COPY tests ./tests
# Expose port
EXPOSE 8000
# Set Python path
ENV PYTHONPATH=/app
# Default command - this can be overridden by testcontainers
CMD ["uvicorn", "tests.integration.main_endless_conditional:app", "--host", "0.0.0.0", "--port", "8000"]