Production environment
The Docker Compose production environment provides an easy way to deploy Polis with the Voxit API Server. It includes a Voxit API Server, all Polis services as well as a PostgreSQL database but no frontend, 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 API Server 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.
POLIS_SERVER_NAME
Set the fully qualified name of the Polis server.
VOXIT_API_SERVER_HOSTNAME
Set the hostname of the Voxit API Server.
VOXIT_API_SERVER_DOMAINNAME
Set the domainname of the Voxit API Server.
VOXIT_API_SERVER_SECRET_KEY
Set the Voxit API Server secret key used for signing cookies and similar needs.
VOXIT_API_SERVER_CORS_ORIGINS
Specify the API frontend 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
POLIS_FROM_ADDRESS
Set the email from address used in emails sent by Polis.
default: "Polis polis@${POLIS_SERVER_NAME}"
EMAIL_TRANSPORT_TYPES
Specify a list of email transports which will be tries in order until sending succeeds (supported values: aws-ses, mailgun, maildev).
AWS_ACCESS_KEY_ID
Specify the AWS SES key ID if the "aws-ses" email transport is used.
AWS_SECRET_ACCESS_KEY
Specify the AWS SES API key if the "aws-ses" email transport is used.
MAILGUN_DOMAIN
Specify the Mailgun domain if the "mailgun" email transport is used.
MAILGUN_API_KEY
Specify the Mailgun API key if the "mailgun" email transport is used.
Running the container environment
Run the following command to build and run the containers:
cd voxit-docker && docker compose up
The Voxit API Server HTTP API server listens on the configured address on port 8000 and the Polis server on port 8001.
Warning
Note that when you make the Polis server publicly available anyone can participate in conversations without authentication, register an account and create new conversations.