Supporting pages, examples and technical details in a cleaner layout.
This page focuses on the Docker side of the API.
For a clean separate API deployment:
militant-api containermilitant-webuploadsUse the dedicated installer:
mkdir -p militant-api-install
cd militant-api-install
curl -fsSLO https://gitlab.com/militant1/api-installer/-/raw/main/militant-api
chmod +x militant-api
./militant-api
You can also start from docker-compose.casaos.yml:
cp docker-compose.casaos.yml docker-compose.api.yml
docker compose -f docker-compose.api.yml up -d
The API should join an existing external network, for example:
networks:
militant_external:
external: true
name: militant_militant_network
The image currently accepts both DB_ and API_DB_ variables.
If you write Compose manually, the safest option is to provide both.
environment:
API_DB_HOST: militant-db
API_DB_NAME: militant
API_DB_USER: militant
API_DB_PASS: your_password
DB_HOST: militant-db
DB_NAME: militant
DB_USER: militant
DB_PASSWORD: your_password
Two valid strategies:
1. shared external Docker volume 2. bind mount to the host uploads directory
Volume example:
volumes:
- militant_militant_uploads:/var/www/uploads
Bind mount example:
volumes:
- /srv/militant/uploads:/var/www/uploads
docker compose -f docker-compose.api.yml pull
docker compose -f docker-compose.api.yml up -d
docker compose -f docker-compose.api.yml logs -f api
docker compose -f docker-compose.api.yml ps
docker compose -f docker-compose.api.yml down
Expose the API behind HTTPS, for example on api.example.org, then enable:
API_REQUIRE_HTTPS=trueAPI_CORS_ORIGINS=https://your-client.example.orgFor the rest, see README.md.