FROM astral/uv:0.11-python3.12-alpine
# Defining env vars
ENV PYCURL_SSL_LIBRARY="openssl"
ENV PYVSS_VERSION="v2026.4.0"
# UV-specific environment variables for container compatibility
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
ARG CI_BUILD_REF
# Defininig tags
LABEL maintainer="Jose Manuel Lopez <jm@eis.utoronto.ca>" \
      ca.utoronto.eis.pyvss.description="This image includes the latest code of PyVSS" \
      ca.utoronto.eis.pyvss.vendor="University of Toronto" \
      ca.utoronto.eis.pyvss.version="${PYVSS_VERSION}" \
      ca.utoronto.eis.pyvss.commit="$CI_BUILD_REF"
# move to app and copy src
WORKDIR /usr/src/app
# Copy lock file and pyproject.toml first for better layer caching
COPY pyproject.toml uv.lock ./
# Copy the rest of the source
COPY . .
# install OS reqs
RUN apk add --no-cache --virtual build-dependencies \
    gcc musl-dev bash rust \
    libxml2-dev libxslt-dev && \
    rm -rf /var/cache/apk/*
# install app using uv
RUN uv sync --locked --all-extras
# define volumes
VOLUME ["/data"]
