FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PIPELINE_BASE=/opt/teleo-eval

WORKDIR /app

RUN apt-get update \
  && apt-get install -y --no-install-recommends ca-certificates curl git bash \
  && rm -rf /var/lib/apt/lists/*

COPY pyproject.toml README.md /app/
COPY lib /app/lib
COPY tests /app/tests
COPY scripts /app/scripts
COPY fixtures /app/fixtures
COPY schemas /app/schemas
COPY systemd /app/systemd
COPY deploy /app/deploy
COPY diagnostics /app/diagnostics
COPY telegram /app/telegram
COPY teleo-pipeline.py /app/teleo-pipeline.py
COPY docker/gcp-staging-smoke.sh /usr/local/bin/gcp-staging-smoke

RUN pip install --no-cache-dir --upgrade pip \
  && pip install --no-cache-dir -e ".[dev]" \
  && chmod +x /usr/local/bin/gcp-staging-smoke

CMD ["/usr/local/bin/gcp-staging-smoke"]
