From 521a9b087ddbf4e7ea5f9db500dba043bb205d36 Mon Sep 17 00:00:00 2001 From: Andrey Kondratev <81143241+cockroach-eater@users.noreply.github.com> Date: Fri, 29 Aug 2025 14:19:40 +0500 Subject: [PATCH] cert fix --- .serena/memories/postgres_healthcheck_fix.md | 20 ++++++++++++++++++++ docker-compose.yml | 9 +++++---- 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 .serena/memories/postgres_healthcheck_fix.md diff --git a/.serena/memories/postgres_healthcheck_fix.md b/.serena/memories/postgres_healthcheck_fix.md new file mode 100644 index 0000000..07a7573 --- /dev/null +++ b/.serena/memories/postgres_healthcheck_fix.md @@ -0,0 +1,20 @@ +# PostgreSQL Connection Fix + +## Problem +App was trying to connect to PostgreSQL before it was ready, causing ECONNREFUSED errors. + +## Solution +Modified docker-compose.yml to use proper depends_on with condition: + +```yaml +depends_on: + traefik: + condition: service_started + postgres: + condition: service_healthy +``` + +This ensures the app waits for PostgreSQL healthcheck to pass before starting. + +## Status +Fixed - ready for production deployment test. \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 765e03e..1f2dfd3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,8 +13,7 @@ services: - --providers.docker.exposedbydefault=false - --entrypoints.web.address=:80 - --entrypoints.websecure.address=:443 - - --certificatesresolvers.letsencrypt.acme.httpchallenge=true - - --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web + - --certificatesresolvers.letsencrypt.acme.tlschallenge=true - --certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL:-admin@example.com} - --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json - --log.level=INFO @@ -85,8 +84,10 @@ services: - "traefik.http.routers.quixotic-http.middlewares=redirect-to-https" - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" depends_on: - - traefik - - postgres + traefik: + condition: service_started + postgres: + condition: service_healthy networks: - quixotic