Skip to content

Conversation

@davidbeig
Copy link
Contributor

@davidbeig davidbeig commented Oct 16, 2025

This PR closes #113 .

We are adding a script that enables the creation of a Decidim instance based on the docker images built in this repository. The user will be guided through some questions on how to properly configure the instance, and the script itself will take care of the necessary dependencies (such as the database, where the storage is going to be located, etc).

Some improvements:

  • Checksum every file.
    This will generate extra-security on the download of the shell script and the files it uses, giving the final user more security.
  • Add health capabilities to the containers.

What we still need

  • We need a way to deliver releases of the install script. Currently there's a github action to create a .zip file that the script is going to download in the server and build from there all the infrastructure.

How to test

Using the released zip.

sudo curl -s https://raw.githubusercontent.com/decidim/docker/refs/heads/feat/decidim_install/install/install.sh | bash

While developing we might not have access to the released zip, the way to test it is to zip ourselfs the script folder and push it to the server.

cd install
zip -r deploy.zip *
scp deploy.zip user@ip:/tmp/decidim-docker/install

Later on, we need the deploy.zip to be under the /tmp/decidim-docker-files/deploy.zip. It's a bit messy right now.

Also, if you want to try it locally you can use multipass

cd install
zip -r deploy.zip 
cd ..
multipass launch --name decidim-docker --cpus 2 --memory 4G --disk 20G
multipass mount . decidim-docker:/home/ubuntu/decidim-docker
multipass shell decidim-docker
cd decidim-docker
bash install/install.sh

@davidbeig davidbeig self-assigned this Oct 16, 2025
@davidbeig davidbeig marked this pull request as ready for review December 11, 2025 08:58
@andreslucena
Copy link
Member

@davidbeig can you check the qlty check blocking issues: https://qlty.sh/gh/decidim/projects/docker/pull/119/issues

As we've talked, @microstudi will do the first round and @greenwoodt will check out the English messages and tone.

Afterwards we'll check this out as @decidim/maintainers

Copy link

@microstudi microstudi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one pain point when configuring the SMTP

Asked values are not explained, we should explain every parameter as most people won't undersand the meaning of each var:

so, instead of "SMTP_USERNAME", maybe somthing like:

SMTP Username (this is usually the email used to send emails)

Speacially confusing the difference between SMPT_ADRESS and SMTP_DOMAIN, we should explain the difference between these two!

Image

I found another problem at the end of the script:

Image

@davidbeig
Copy link
Contributor Author

I found one pain point when configuring the SMTP

Asked values are not explained, we should explain every parameter as most people won't undersand the meaning of each var:

so, instead of "SMTP_USERNAME", maybe somthing like:

SMTP Username (this is usually the email used to send emails)

Speacially confusing the difference between SMPT_ADRESS and SMTP_DOMAIN, we should explain the difference between these two!
Image

I found another problem at the end of the script:
Image

The last part of the script you see comes from the log of the application running.

It's, in fact, expected. It comes from this:
docker compose logs --tail=30

Since there are gems to install, the bundle check fails and then executes the bundle install.

I'm changing the wording in that part of the script to be explicit about this.

Copy link

@greenwoodt greenwoodt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some standard but very minor changes to wording of script language communicating to the implementer during the installation. Also adding consistency to what you've already done.

Take a long and let me know what you think @davidbeig :)

All in all really beautifully described!

echo -e "* • SMTP server settings for emails *"
echo -e "* • File storage settings (local or S3) *"
echo -e "* *"
echo -e "* 💡 All dependencies (Docker, etc.) will be installed for you *"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo -e "* 💡 All dependencies (Docker, etc.) will be installed for you *"
echo -e "* 💡 All dependencies (Docker, etc) will be installed for you. *"

mkdir "$TMP"
fi

echo "📥 Downloading the installation necessary files."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "📥 Downloading the installation necessary files."
echo "📥 Downloading the necessary installation files."

# Check if .env file exists
if [ ! -f "$ENV_FILE" ]; then
echo "❌ Error: .env file not found at $ENV_FILE"
echo " Please run the installation script first or create the .env file manually."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo " Please run the installation script first or create the .env file manually."
echo "Please run the installation script first or create the .env file manually."


docker compose --env-file "$ENV_FILE" up -d

echo "📋 Showing recent container logs..."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "📋 Showing recent container logs..."
echo "📋 Displaying recent container logs..."

echo "🐛 Issues: https://github.com/decidim/decidim/issues"
echo "🐛 Installation Issues: https://github.com/decidim/docker/issues"
echo
echo "Have fun using Decidim! 🗳️"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Have fun using Decidim! 🗳️"
echo "Enjoy using Decidim! 🗳️"

Its definitely sincere, however to avoid interpreting what "could" be translated as condescending.

build_external_database() {
echo "📋 External Database Configuration"
echo " Please provide your external database details:"
echo " 💡 Make sure your database server allows connections from this machine"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo " 💡 Make sure your database server allows connections from this machine"
echo " 💡 Make sure your database server allows connections from this machine."

MAPS_API_PROVIDER=${MAPS_API_PROIVDER=-here}

echo "───────────────────────────────────────────────"
echo "Now we are going to create the .env file."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Now we are going to create the .env file."
echo "✍️ Now we are going to create the .env file."

export VAPID_PUBLIC_KEY
export VAPID_PRIVATE_KEY

echo "🔑 Keys successfully extracted"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "🔑 Keys successfully extracted"
echo "🔑 Keys successfully extracted!"

exit 1
fi

echo "Correct distribution."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Correct distribution."
echo "Correct distribution."

if [ -z "$SKIP_MIGRATIONS" ]; then
bundle exec rails db:migrate
else
echo "⚠️ Skipping migrations"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "⚠️ Skipping migrations"
echo "⚠️ Skipping migrations!"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a decidim-install.sh script that can handle the installation of a Decidim instance

5 participants