Skip to content
Snippets Groups Projects
Select Git revision
  • 5a0a39001b36e249c43e8991932c6bfd67f3b8d2
  • main default protected
  • ci_test
  • v2.0.27 protected
  • v2.0.26 protected
  • v2.0.25 protected
  • v2.0.24 protected
  • v2.0.23 protected
  • v2.0.22 protected
  • v2.0.21 protected
  • v2.0.20 protected
  • v2.0.19 protected
  • v2.0.18 protected
  • v2.0.17 protected
  • v2.0.16 protected
  • v2.0.15 protected
  • v2.0.14 protected
  • v2.0.13 protected
  • v2.0.12 protected
  • v2.0.11 protected
  • v2.0.10 protected
  • v2.0.9 protected
  • v2.0.8 protected
23 results

Dockerfile

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Dockerfile 1.13 KiB
    FROM python:3.13-slim AS base
    
    # READ THE NOTE on caching in the README before changing this/for more info!
    ARG PIP_CACHE_DIR=
    ARG APT_CACHE_DIR=
    RUN rm -f /etc/apt/apt.conf.d/docker-clean
    RUN if ! [ -z "$APT_CACHE_DIR" ]; then echo "Dir::Cache::Archives $APT_CACHE_DIR" >>  /etc/apt/apt.conf.d/ci_caching; fi
    
    
    WORKDIR /code
    
    RUN mkdir -p /code
    WORKDIR /code
    
    # Install and build requirements in different image too reduce final image size
    FROM base AS builder
    
    # Packages needed to build psycopg with pip
    # READ THE NOTE on caching in the README before changing this/for more info!
    RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
        --mount=type=cache,target=/var/lib/apt,sharing=locked \
        apt-get update && apt-get --no-install-recommends install -y libpq-dev gcc python3-dev
    
    COPY requirements.txt /code
    RUN python -m venv --without-pip .venv/
    RUN --mount=type=cache,target=/root/.cache/pip \
        pip --python /code/.venv/bin/python install -r requirements.txt
    
    FROM base AS final
    
    # Copy venv created in builder image with the dependencies
    COPY --from=builder /code/.venv /code/.venv
    
    COPY src/videoag_common /code/src/videoag_common