Advanced usage
Enabling HTTPS
While in most cases HTTP is sufficient, you may want to enable HTTPS in Micro (for an example of when that’s useful, see Locally resolving an existing domain name to Micro).
You will need an SSL/TLS certificate in PKCS 12 format (.p12
). Pass your certificate file and its password to the container (using a bind mount and an environment variable). Don’t forget to expose the HTTPS port (by default, 9543):
docker run -p 9090:9090 -p 9543:9543 \
--mount type=bind,source=$(pwd)/my-certificate.p12,destination=/config/ssl-certificate.p12 \
-e MICRO_SSL_CERT_PASSWORD=... \
snowplow/snowplow-micro:2.1.2
For the certificate, the path inside the container must be exactly /config/ssl-certificate.p12
.
You should see a message like this in the logs:
[INFO] com.snowplowanalytics.snowplow.micro.Main$ - HTTPS REST interface bound to /0.0.0.0:9543
As usual, you can change the ports to your liking (see Running Micro).
Adding custom Iglu resolver configuration
If you’d like to tweak the Iglu registries Micro uses, the priority between them, the cache sizes, etc, you can provide your own Iglu resolver configuration (iglu.json
).
If you are just looking to add custom schemas or connect to your private Iglu registry, check out Adding custom schemas for simpler ways to achieve that.
Pass your configuration file to the container (using a bind mount) and instruct Micro to use it:
docker run -p 9090:9090 \
--mount type=bind,source=$(pwd)/iglu.json,destination=/config/iglu.json \
snowplow/snowplow-micro:2.1.2 \
--iglu /config/iglu.json
That’s it. You can use the the API to check if Micro is able to reach your schemas (replace com.example
and my-schema
as appropriate).
curl localhost:9090/micro/iglu/com.example/my-schema/jsonschema/1-0-0
Adding custom collector configuration
If you’d like to tweak the collector configuration inside Micro, the simplest approach is to override individual settings. For example, to change the cookie name:
docker run -p 9090:9090 \
snowplow/snowplow-micro:2.1.2 \
-Dcollector.cookie.name=sp
For more extensive changes, you can also bring your own configuration file (micro.conf
).
Example
loading...
Pass your configuration file to the container (using a bind mount) and instruct Micro to use it:
docker run -p 9090:9090 \
--mount type=bind,source=$(pwd)/micro.conf,destination=/config/micro.conf \
snowplow/snowplow-micro:2.1.2 \
--collector-config /config/micro.conf