-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.api
More file actions
28 lines (22 loc) · 1017 Bytes
/
Copy pathDockerfile.api
File metadata and controls
28 lines (22 loc) · 1017 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
# Dockerfile.api - SESTRAV FastAPI Microservice
# Minimal image: installs only the core ML stack + API dependencies.
FROM python:3.13-slim@sha256:f82c96458eedc847b233e582eb31336f4954b39cae020b6dcf5b3ed0e5cbcd74
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -s /bin/bash sestrav_user
WORKDIR /app
RUN chown -R sestrav_user:sestrav_user /app
USER sestrav_user
ENV PATH="/home/sestrav_user/.local/bin:${PATH}"
ENV PYTHONUNBUFFERED=1
# Copy minimal source needed for the API
COPY --chown=sestrav_user:sestrav_user pyproject.toml README.md ./
COPY --chown=sestrav_user:sestrav_user src/ ./src/
COPY --chown=sestrav_user:sestrav_user api/ ./api/
COPY --chown=sestrav_user:sestrav_user config.yaml ./
RUN pip install --user --no-cache-dir "pip==26.1.2" && \
pip install --user --no-cache-dir ".[api]"
EXPOSE 8000
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]