Using Docker
With Docker
1. Configure
mcaptcha is highly configurable.
Configuration is applied/merged in the following order:
- path to configuration file passed in via
MCAPTCHA_CONFIG
./config/default.toml
/etc/mcaptcha/config.toml
- environment variables.
See CONFIGURATION.md for configurable options.
2. Run image
If you have already have a Postgres instance running, then:
1docker run -p <host-machine-port>:<port-in-configuration-file> \
2 --add-host=database:<database-ip-addrss> \
3 -e RUST_LOG=debug \
4 -e DATABASE_URL="postgres://<db-user>:<db-password>@database:<db-port>/<db-name>" \
5 mcaptcha/mcaptcha:latest
If you don’t have a Postgres instance running, you can either install one using a package manager or launch one with docker. A docker-compose configuration is available that will launch both a database instance mcaptcha instance.
With docker-compose
Follow steps above to build docker image.
Set database password docker-compose configuration.
Launch network
1docker-compose up -d