From f8d90528f317eb9a60c4aebc6825cc1b620c36cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Pereira=20de=20Lucena?= Date: Thu, 22 Jan 2026 10:12:59 +0100 Subject: [PATCH 1/2] Add 'decidim-hello-world' preffix to singal that this isn't production ready --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index cf5bcd45..d6e2ef50 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3' +name: decidim-hello-world services: decidim: image: decidim/decidim:latest From 97480e4583942ccb3a0a0ccbf4e48324a300b829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Pereira=20de=20Lucena?= Date: Thu, 22 Jan 2026 10:13:32 +0100 Subject: [PATCH 2/2] Fix postgres instructions - Prefer usage of postgres vs pg - Ping the image to supported postgres version - Fix the environment variables so we don't need to use 'trust' - Hardcode the postgres DB password (this is just a demo) - Add healthcheck - Add explicit depenency between decidim and postgres --- docker-compose.yml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d6e2ef50..dfd5cba1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,23 +13,37 @@ services: # Makes our entrypoint scripts available to the container # under /code/vendor - ./scripts:/code/vendor + depends_on: + postgres: + condition: service_healthy environment: - RAILS_ENV=development - - DATABASE_HOST=pg + - DATABASE_HOST=postgres - DATABASE_USERNAME=postgres + - DATABASE_PASSWORD=postgres links: - - pg + - postgres - redis - pg: - image: postgres + + postgres: + image: postgres:16.1 volumes: - - pg-data:/var/lib/postgresql/data + - postgres-data:/var/lib/postgresql/data + networks: + - default environment: - - POSTGRES_HOST_AUTH_METHOD=trust + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 5s + retries: 5 + redis: image: redis volumes: - redis-data:/data volumes: - pg-data: {} + postgres-data: {} redis-data: {}