From 32888243830d4053ea47406aa4b7099b4458773b Mon Sep 17 00:00:00 2001 From: Kobe Date: Sun, 8 Jun 2025 13:55:57 +0200 Subject: [PATCH] Update docker-compose.yml --- docker-compose.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ca3c50f..c819072 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,10 @@ version: '3.8' +networks: + docupulse_${PORT:-10335}_network: + name: docupulse_${PORT:-10335}_network + driver: bridge + services: web: build: @@ -10,9 +15,9 @@ services: environment: - FLASK_APP=app.py - FLASK_ENV=production - - DATABASE_URL=postgresql://postgres:postgres@db:5432/docupulse_${PORT:-10335} - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres + - DATABASE_URL=postgresql://docupulse_${PORT:-10335}:docupulse_${PORT:-10335}@db:5432/docupulse_${PORT:-10335} + - POSTGRES_USER=docupulse_${PORT:-10335} + - POSTGRES_PASSWORD=docupulse_${PORT:-10335} - POSTGRES_DB=docupulse_${PORT:-10335} - MASTER=${ISMASTER:-false} volumes: @@ -31,21 +36,25 @@ services: limits: cpus: '1' memory: 1G + networks: + - docupulse_${PORT:-10335}_network db: image: postgres:13 environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres + - POSTGRES_USER=docupulse_${PORT:-10335} + - POSTGRES_PASSWORD=docupulse_${PORT:-10335} - POSTGRES_DB=docupulse_${PORT:-10335} volumes: - docupulse_postgres_data:/var/lib/postgresql/data restart: unless-stopped healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres"] + test: ["CMD-SHELL", "pg_isready -U docupulse_${PORT:-10335}"] interval: 30s timeout: 10s retries: 3 + networks: + - docupulse_${PORT:-10335}_network volumes: docupulse_postgres_data: