Skip to content

Instantly share code, notes, and snippets.

@jnovinger
Last active October 7, 2025 18:33
Show Gist options
  • Select an option

  • Save jnovinger/c0f2caefedce3b501e63f43a40499cd5 to your computer and use it in GitHub Desktop.

Select an option

Save jnovinger/c0f2caefedce3b501e63f43a40499cd5 to your computer and use it in GitHub Desktop.

Revisions

  1. jnovinger revised this gist Oct 7, 2025. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Dockerfile.test
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,7 @@ FROM ubuntu:24.04
    RUN apt-get update && apt-get install -y \
    imagemagick \
    libgraphicsmagick1-dev \
    libgraphicsmagick++1-dev \
    graphicsmagick \
    libjpeg62 \
    zlib1g-dev \
  2. jnovinger created this gist Oct 7, 2025.
    39 changes: 39 additions & 0 deletions Dockerfile.test
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    FROM ubuntu:24.04

    # Install dependencies including Python 3.9 and 3.12
    RUN apt-get update && apt-get install -y \
    imagemagick \
    libgraphicsmagick1-dev \
    graphicsmagick \
    libjpeg62 \
    zlib1g-dev \
    redis-server \
    libvips-tools \
    python3 \
    python3-pip \
    python3-venv \
    software-properties-common \
    lsof \
    && add-apt-repository ppa:deadsnakes/ppa -y \
    && apt-get update \
    && apt-get install -y python3.9 python3.9-venv python3.9-dev python3.12 python3.12-venv python3.12-dev \
    && rm -rf /var/lib/apt/lists/*

    # Show ImageMagick version
    RUN convert --version

    WORKDIR /app

    # Copy project files
    COPY . /app/

    # Install tox with gh-actions plugin and Pillow for debug scripts
    RUN pip3 install --break-system-packages tox tox-gh-actions Pillow

    # Usage:
    # Build: docker build -f Dockerfile.test -t sorl-im6-test .
    # Run all environments: docker run sorl-im6-test
    # Run specific environment: docker run sorl-im6-test sh -c "redis-server --daemonize yes && tox -e py39-django42-imagemagick"

    # Start Redis and run tox
    CMD ["sh", "-c", "redis-server --daemonize yes && tox"]