Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Docker Setup Guide

Use Docker to test the iLoveIMG Python library across multiple Python versions (3.10 to 3.14) in isolated environments.


Quick Start

1. Setup Environment Variables

cp .env.example .env

Edit .env with your API credentials from iLoveIMG Developer Portal:

ILOVEIMG_PUBLIC_KEY=your_public_key_here
ILOVEIMG_SECRET_KEY=your_secret_key_here

Important: Never commit .env with real credentials.


2. Build Images

docker-compose -f .docker/docker-compose.yml build

3. Run Tests

docker-compose -f .docker/docker-compose.yml run --rm python310

Common Commands

Run Specific Test Types

# Unit tests only
docker-compose -f .docker/docker-compose.yml run --rm python310 pytest tests/unit

# Integration tests only
docker-compose -f .docker/docker-compose.yml run --rm python310 pytest tests/integration

# Specific test file
docker-compose -f .docker/docker-compose.yml run --rm python310 pytest tests/unit/test_compress_task.py

Test Different Python Versions

Available: python310, python311, python312, python313, python314

docker-compose -f .docker/docker-compose.yml run --rm python312 pytest tests/unit

Rebuild After Code Changes

docker-compose -f .docker/docker-compose.yml build python310

Rebuild from Scratch

docker-compose -f .docker/docker-compose.yml build --no-cache python310

Open Shell Inside Container

docker-compose -f .docker/docker-compose.yml run --rm python310 bash

Troubleshooting

TTY Error

If you see "the input device is not a TTY", add -T flag:

docker-compose -f .docker/docker-compose.yml run --rm -T python310 pytest tests/unit

Import Errors After Code Changes

Rebuild the image:

docker-compose -f .docker/docker-compose.yml build python310

Authentication Errors

  • Verify .env file exists in project root with valid credentials
  • Check you copied it from .env.example
  • Integration tests require valid API credentials

Additional Information