-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) · 863 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (23 loc) · 863 Bytes
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
# Use an official lightweight Python image
FROM python:3.12-slim
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
# Set working directory
WORKDIR /app
# Enable bytecode compilation
ENV UV_COMPILE_BYTECODE=1
# Copy dependency files AND README
COPY pyproject.toml uv.lock README.md ./
# Install dependencies
RUN uv sync --frozen
# IMPORTANT: Add the virtual environment to the PATH
# This ensures that 'python' and 'uvicorn' point to the versions inside the venv
ENV PATH="/app/.venv/bin:$PATH"
# Copy the source code
COPY src ./src
# Set PYTHONPATH so python can find our modules
ENV PYTHONPATH=/app/src
# Default command
CMD ["uvicorn", "esios_ingestor.web.app:app", "--host", "0.0.0.0", "--port", "8000"]