octree-gva / docker

Docker images for decidim
https://decidim.org
GNU Affero General Public License v3.0
1 stars 0 forks source link

Docker Hub

Decidim

The participatory democracy framework

Free Open-Source participatory democracy, citizen participation and open government for cities and organizations.
Explore the docs »

Join our Matrix.org chat rooms.

Features · Roadmap · Decidim on Docker: Report Bug · Propose New Features · Decidim main repository


Dockerhub

Stable tags

:0.27,:0.28,:0.29

Development tags

:nightly

▶️ 5min tutorial

Ready to mount a Decidim installation locally in 5min? Follow our 5min tutorial to setup Decidim with Docker locally.

Eject you decidim instance

You want to publish your instance on a git? You can copy all files of your decidim container in your local environment with docker cp

docker-compose up -d
docker cp decidim:/home/decidim/app ready-to-publish # Wait the command finishes!
cd ready-to-publish && git init
# Follow your git client instructions to upload this repo to github

Once ejected, you will have a Dockerfile and docker-compose ready to use on your ejected application.

Environments configurations

🔐: be sure to read the good practices ;)

Env Name Description Default
DECIDIM_SYSTEM_EMAIL Email use to access /system hello@myorg.com
DECIDIM_SYSTEM_PASSWORD Password use to access /system my_insecure_password
SECRET_KEY_BASE 🔐 Secret used to initialize application's key generator my_insecure_password
RAILS_MASTER_KEY 🔐 Used to decrypt credentials file my_insecure_password
RAILS_FORCE_SSL If rails should force SSL false
RAILS_MAX_THREADS How many threads rails can use 5
RAILS_SERVE_STATIC_FILES If rails should be accountable to serve assets false
RAILS_ASSET_HOST If set, define the assets are loaded from (S3?) ``
SIDEKIQ_CONCURRENCY Concurrency for sidekiq worker. MUST be <= DATABASE_MAX_POOL_SIZE RAILS_MAX_THREADS
DATABASE_MAX_POOL_SIZE Max pool size for the database. RAILS_MAX_THREADS
DATABASE_URL Host for the postgres database. pg
TZ Timezone used Europe/Madrid
REDIS_URL Redis url for sidekiq redis
SMTP_AUTHENTICATION How rails should authenticate to SMTP plain, none
SMTP_USERNAME Username for SMTP my-participatory-plateform@iredmail.org
SMTP_PASSWORD 🔐 Password for SMTP my_insecure_password
SMTP_ADDRESS SMTP address smtp.iredmail.org
SMTP_DOMAIN SMTP HELO Domain iredmail
SMTP_PORT SMTP address port 587
SMTP_STARTTLS_AUTO If TLS should start automatically enabled
SMTP_VERIFY_MODE How smtp certificates are verified none

All the DECIDIM_ variables are available. See the documentation on default environments variables.

Cron configurations

Cron is configured to run scripts every 15min, 1hour, daily, weekly, monthly. When the times comes, it will execute all scripts present in the /etc/periodic directory. By default, the following scripts are executed:

├── 15min
│   └── change_active_steps.sh
├── daily
│   ├── daily_digest.sh
│   ├── open_data_export.sh
│   └── reminders_all.sh
├── hourly
│   ├── compute_metrics.sh
│   └── delete_download_your_data_files.sh
├── monthly
└── weekly
    ├── clean_registration_forms.sh
    └── weekly_digest.sh

To configure this, you can copy this cron.d directory, change the scripts and map a volume. Carefull, these scripts need permission to be executed, don't forget to chmod +x any new scripts.

# Copy the container directory locally
docker cp decidim:/etc/periodic crontab.d

And update your docker-compose:

    container_name: decidim
    image: decidim/decidim:latest
    ports:
      - 3000:3000
    volumes:
      - storage:/home/decidim/app/storage
+     - ./crontab.d:/etc/periodic
+   environment:
-   environment:    

If you don't use docker image to run your cron and prefer using a schedulder, you can get the commands in the crontab file

Entrypoints

Before running the docker command, we go through entrypoints scripts. Theses commands will run on each container restart:

Command

You can update your docker-compose command to whatever you want. It is common to see one of these:

Extend Decidim Images

Let say you want to use official image, but a binary is missing. For the sake of the example, let's add restic a binary to manage encrypted backups.

# Your new custom image
FROM decidim:0.29.1-onbuild
RUN apk --update --no-cache restic
# You are done, restic is now available in your image.

Run Decidim in development/test mode

The docker-compose docker-compose.NAME_YOUR_VERSION.dev.yml allows you to run decidim in development or test mode. They are larger images, and are not suited for production usage.

Contribute

See CONTRIBUTING.md for more informations. PR are Welcome ❤️

How Does It Works

This repository is designed to automate the publication of Decidim versions using Docker containers, along with generating documentation to use these containers.

Decidim Version Management

Docker Image Automation

Documentation Generation

Repository Structure

License

This repository is under GNU AFFERO GENERAL PUBLIC LICENSE, V3.