- Install the dependencies by creating a virtual environment
git clone https://github.com/grittypuffy/pact-backend
cd pact-backend
poetry env use python3.13
source $(poetry env info --path)/bin/activate
poetry install
- Generate self-signed certificates for HTTPS, this is needed to set cookies during local development. Install mkcert to generate it.
mkdir certs
cd certs
mkcert localhost
- Start the development server in the project root directory by the following command once the environment variables have been configured correctly as per .env sample:
poetry run python -m uvicorn --ssl-certfile certs/localhost.pem --ssl-keyfile certs/localhost-key.pem --workers 4 pact_backend.server:app --reload
This should start the development server at https://0.0.0.0:8000/
- Build the Docker image using the following command:
docker buildx build -t pact-backend:latest .
- Deploy it using docker run command or by pushing to a container registry (Azure Container Registry or Docker Hub) by tagging the image appropriately.