1.7 KiB
1.7 KiB
title | description | date | lastmod | draft | images | menu | weight | toc | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Using Docker | Deploy mCaptcha using docker | 2021-07-21 15:14 | 2021-07-21 15:14 | false |
|
534 | true |
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:
docker run -p <host-machine-port>:<port-in-configuration-file> \
--add-host=database:<database-ip-addrss> \
-e RUST_LOG=debug \
-e DATABASE_URL="postgres://<db-user>:<db-password>@database:<db-port>/<db-name>" \
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.
With docker-compose
- Download docker-compose file and the configuration file:
wget https://raw.githubusercontent.com/mCaptcha/mCaptcha/master/.env.docker-compose
wget https://raw.githubusercontent.com/mCaptcha/mCaptcha/master/docker-compose.yml
-
Configure deployment using
.env.docker-compose
environment variable file -
Launch containers:
docker-compose up -d
- Configure SSL using reverse proxy: mCaptcha doesn't support SSL at the moment, so please use a reverse proxy to secure your instance. A reference nginx virtual host configuration file is available here.