Running with Docker¶
Miasma offers an official docker image.
Create a container using your preferred docker setup. Miasma binds to port 9999, but you can expose whatever port you'd like.
You can view a response with:
Configuration¶
You can pass configuration options as command-line flags:
You may also create a config file and provide access to the container.
docker run --rm -p 9999:9999 \
-v <PATH_TO_CONFIG>:/etc/miasma-config.yaml:ro \
austinweeks/miasma:latest \
--config-file /etc/miasma-config.yaml # (1)!
- This gives the container read-only access to the config file on your machine. Note that the path must be absolute. You can easily grab this by using
$(pwd)/config.yaml.
services:
miasma:
image: austinweeks/miasma:latest
volumes:
- <DIR_WITH_CONFIG>:/etc/config-dir:ro # (1)!
command: --config-file /etc/config-dir/miasma-config.yaml
ports:
- 9999:9999
- This gives the container read-only access to a directory with the config file on your machine. The path may be relative or absolute. Note: You must bind to a directory, as Docker Compose does not allow binding to specific files.
Tracking Metrics¶
Miasma's metrics feature allows you to track scrapers that interact with Miasma. Because the feature writes data to a SQLite file, it's necessary to provide the container with a volume where this data can be stored.
docker run --rm -p 9999:9999 \
-v <PATH_TO_DATA_DIR>:/data \
austinweeks/miasma:latest \
--metrics-db-path /data/miasma.db \
--metrics-username <USERNAME> \
--metrics-password <PASSWORD> # (1)!
- This gives the container write access to a directory of your choosing. Miasma will create a
miasma.dbfile in this directory on startup, or reuse one from previous runs.
Please see the metrics page for more information on setting up metrics.