Skip to content

Latest commit

 

History

History
72 lines (53 loc) · 2.1 KB

File metadata and controls

72 lines (53 loc) · 2.1 KB

Docker Setup for Product Matcher

This project has been containerized with Docker. The Docker image is configured to run the product matching system with the following command:

python3 main.py --client dataset/competitor_a_products.csv --competitor dataset/competitor_b_products.csv --output output/result.json --min-confidence 0.5 --sample-size 50

Files Created

  • Dockerfile - Docker image definition
  • requirements.txt - Python dependencies
  • docker-compose.yml - Docker Compose configuration for easy execution
  • .dockerignore - Updated to exclude unnecessary files from the Docker build

Building the Docker Image

Option 1: Using Docker directly

docker build -t product-matcher .

Option 2: Using Docker Compose

docker-compose build

Running the Container

Option 1: Using Docker directly

docker run --rm -v $(pwd)/output:/app/output product-matcher

Option 2: Using Docker Compose (Recommended)

docker-compose up

The output will be saved to output/result.json on your host machine.

Custom Parameters

To run with different parameters, you can override the command:

Using Docker

docker run --rm -v $(pwd)/output:/app/output product-matcher \
  python3 main.py \
  --client dataset/competitor_a_products.csv \
  --competitor dataset/competitor_b_products.csv \
  --output output/result.json \
  --min-confidence 0.7 \
  --sample-size 100

Using Docker Compose

Modify the command section in docker-compose.yml or run:

docker-compose run product-matcher python3 main.py --client dataset/competitor_a_products.csv --competitor dataset/competitor_b_products.csv --output output/result.json --min-confidence 0.7 --sample-size 100

Output

The results will be written to output/result.json in the project directory (mounted as a volume from the container).

Troubleshooting

If you encounter network issues when building the image (Docker registry timeout), try:

  1. Check your internet connection
  2. Use a VPN if Docker Hub is blocked in your region
  3. Configure Docker to use a different registry mirror