panzi / verify-ehc

Simple Python script to decode and verify an European Health Certificate QR-code
60 stars 17 forks source link

Building and running in Docker Container #28

Closed bluepuma77 closed 2 years ago

bluepuma77 commented 2 years ago

I tried to run it on my local machine but had problems with building the crypto libraries locally.

But you can run verify-ehc easily in a Docker container

#Dockerfile
FROM python:3

RUN apt update
RUN apt install -y build-essential libssl-dev libffi-dev python3-dev cargo

WORKDIR /usr/src/app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD [ "python", "./verify_ehc.py" ]

Build docker build -t verify-ehc:latest .

Run to get/update certificates docker run --rm -v $(pwd):/data verify-ehc python ./verify_ehc.py --save-certs /data/certs.json

Run to verify using stored certificates docker run --rm -v $(pwd):/data verify-ehc python ./verify_ehc.py --certs-file /data/certs.json 'HC1:...'

panzi commented 2 years ago

Looks like you wrote all you need already for yourself. I don't have any interest to add a Dockerfile to this script. Sorry.