Production environment
The Docker Compose production environment provides an easy way to deploy Voxit. It includes Voxit participation and administration API servers, the Polis “Math server” as well as a PostgreSQL database but no frontends, OpenID Connect identity provider or email sending service.
Setup
Check out the Voxit repositories into a common base directory:
git clone https://gitlab.com/voxit/voxit-api-server.git
git clone https://gitlab.com/voxit/voxit-docker.git
Configuration
The Polis and Voxit service containers need to be configured before they can be started.
Inside the voxit-docker repository copy env to .env and ensure all mandatory configuration settings mentioned below are set.
DATA_DIR
Specify the base directory where persistent data is stored.
VOXIT_API_SERVER_DIR
Specify the directory containing the voxit-api-server project.
VOXIT_FRONTEND_DIR
Specify the directory containing the voxit-example-frontend project.
POSTGRES_PASSWORD
Set the password of the PostgreSQL user.
VOXIT_API_SERVER_HOSTNAME
Set the hostname of the Voxit participation API server.
VOXIT_API_SERVER_DOMAINNAME
Set the domainname of the Voxit participation API server.
VOXIT_API_SERVER_SECRET_KEY
Set the Voxit participation API server secret key used for signing cookies and similar needs.
NOTE: The key must be regenerated in order to invalidate client-side sessions after the database has been purged!
VOXIT_API_SERVER_CORS_ORIGINS
Specify the API client origin for CORS.
VOXIT_API_SERVER_IDP_API_BASE_URL
Set the OpenID Connect identity provider base URL.
VOXIT_API_SERVER_IDP_CLIENT_ID
Set the OpenID Connect identity provider client ID.
VOXIT_API_SERVER_IDP_CLIENT_SECRET
Set the OpenID Connect identity provider secret.
VOXIT_API_SERVER_AUTHENTICATION_DISABLED
Set to true in order to allow participants to vote and submit statements without authentication (not recommended for publicly accessible instances).
BIND_ADDRESS
Specify the address to listen on.
default: 127.0.0.1
UWSGI_PROCESSES
Set the number of uwsgi processes (see https://uwsgi-docs.readthedocs.io/en/latest/).
default: 4
UWSGI_THREADS
Set the number of uwsgi threads per process (see https://uwsgi-docs.readthedocs.io/en/latest/).
default: 4
UWSGI_REQUEST_TIMEOUT
Set the request timeout in seconds after which a worker is killed (see "harakiri" https://uwsgi-docs.readthedocs.io/en/latest/).
default: 30
UWSGI_MAX_REQUESTS
Set the maximum number of requests after which uwsgi reloads workers (see https://uwsgi-docs.readthedocs.io/en/latest/).
default: 5000
Running the container environment
Run the following command to build and run the containers:
cd voxit-docker && docker compose up
The Voxit participation API server listens on the configured address on port 8000 and the Voxit administration API server on port 8001.