Sign inSign up

devdull/pyxie

By devdull

Updated 12 months ago

A lightweight pixel tracking service written in Python

Image
Web analytics
0

3.6K

devdull/pyxie repository overview

PyXIE

About

A lightweight Tracking Pixel service written in Python.

Installation

Quickstart using Docker
Pull the image from Dockerhub
user@shell> docker pull devdull/pyxie:latest
latest: Pulling from devdull/pyxie

> snip <

Status: Downloaded newer image for devdull/pyxie:latest
docker.io/devdull/pyxie:latest
Create a directory to store PyXIE's data
user@shell> mkdir data
Create your configuration file

When running PyXIE as a Docker image, it is recommended to set the DATABASE_FILE value in config.yaml to ensure that data is persisted between container restarts. Below is a minimal example.

config.yaml:

DATABASE_FILE: /app/data/uadb.json
API_KEYS:
  - your-api-key-here
  - a-different-api-key-here
  - Another API key with spaces and a comma, but this might be hard to use later.
Run the image, mounting the data path and configuration file:
user@shell> docker run -d --mount type=bind,src="./config.yaml",dst="/app/config.yaml" --mount type=bind,src="./data",dst="/app/data" -p 5000:5000 devdull/pyxie:latest
Test the instance
user@shell> curl -X POST -H 'X-Api-Key: your-api-key-here' -d 'id=foo' 'http://localhost:5000/register'
Success
user@shell> ls -l data/  # Confirm the data file exists in the bound directory
total 8
-rw-r--r--  1 user  staff  2043 Jul  8 11:57 uadb.json
Stuff the average user can ignore

The service inside the container is run using Gunicorn. To configure the bind IP and port, you can set the environment variables LISTEN_IP and LISTEN_PORT. These should not be confused for the configuration items used by Flask which can be defined in config.yaml.

Tag summary

Content type

Image

Digest

sha256:773918c4b

Size

43.8 MB

Last updated

12 months ago

docker pull devdull/pyxie