This project allows the deployment of pol.is and participa for them to work together.
This will clone polis project and participa project, you should do this only once.
make init
Edit the three .env files for each environment (dev.env, test.env, prod.env) and set the variables of the section "PLATAFORMA PARTICIPA VARIABLES".
Example:
# PLATAFORMA PARTICIPA VARIABLES
MAIN_DOMAIN = "app.raul"
POLIS_SUBDOMAIN = "polis"
POLIS_DOMAIN = "${POLIS_SUBDOMAIN}.${MAIN_DOMAIN}"
POLIS_GIT_BRANCH = "edge"
POLIS_GIT_SHA=#Empty to use the latest commit of the branch
PARTICIPA_GIT_BRANCH = "main"
PARTICIPA_GIT_SHA=#Empty to use the latest commit of the branch
SERVER_ENV_FILE=dev.env
TAG=dev
COMPOSE_PROJECT_NAME=plataforma-${TAG}
DEV_MODE=true
SERVER_LOG_LEVEL=info
DEBUG=true
Add domain names as server names in nginx/default.conf
This will make the polis project to be accessible at polis.app.raul and the main participa project to be accessible at app.raul.
Locally, it is better to define a domain for the project in your /etc/hosts file, for example:
127.0.0.1 app.raul
127.0.0.1 polis.app.raul
"localhost" can be problematic in Docker, so it is better to use a domain. Remember to flush your DNS cache after editing the /etc/hosts file.
It's important that the DEV_MODE variable is set to true in the .env file. This relates to pol.is avoiding the use of HTTPS in the development environment. It's recommended that the DEBUG variable is set to true in the .env file. This will allow you to see the logs of the django server.
To start the development environment, run:
make start
If you change the .env file, you should use after the change:
make start-recreate
If you want to wipe everything (INCLUDING THE DATABASE) and start from scratch, you can use:
make start-FULL-REBUILD
If you want to rebuild a specific service, you can use:
make build-participa
and
make start-recreate-participa
It's important that the DEV_MODE variable is set to false in the .env file. This relates to pol.is using HTTPS in the test and production environment. It's recommended that the DEBUG variable is set to false in the .env file. This will avoid showing the logs of the django server.
To start the test environment, run:
make TEST run
To start the production environment, run:
make PROD run
After starting the project, you can access the polis project at polis.app.raul and the main participa project at app.raul.
- Create user in polis, accesing polis.app.raul/createuser (this url should be accesible only in development environment)
- Go to "Integrate" tab in polis and copy site_id
- Create django superuser in participa
docker-compose exec participa python manage.py createsuperuser
- Access the admin panel at app.raul/admin and login with the superuser credentials
- Create a polis instance with the site_id copied from polis, and the url of the polis project (polis.app.raul)
- Create a conversation. You can now access the conversation at app.raul/polis/<conversation_id>