From af95c2e55f5c7b033609ed891b3b5d51e2f80090 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Thu, 23 Jan 2025 10:22:07 +0800 Subject: [PATCH] chore: update environment variables in compose.yaml - Replace hardcoded DATABASE_URL and RAILS_MASTER_KEY with environment variables. - Change POSTGRES_PASSWORD to utilize an environment variable instead of a hardcoded value. These changes enhance security by ensuring sensitive information is not exposed in the configuration files, allowing for better practices in managing environment variables. --- compose.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compose.yaml b/compose.yaml index fa814e7..1e33ae1 100644 --- a/compose.yaml +++ b/compose.yaml @@ -7,8 +7,8 @@ services: # - "3000:3000" environment: - RAILS_ENV=production - - DATABASE_URL=postgresql://postgres:xxx@db:5432/db - - RAILS_MASTER_KEY=xxx + - DATABASE_URL=postgresql://postgres:${PG_PASSWORD}@db:5432/db + - RAILS_MASTER_KEY=${RAILS_MASTER_KEY} - REDIS_URL=redis://redis:6379/0 depends_on: - db @@ -19,8 +19,8 @@ services: command: bundle exec sidekiq environment: - RAILS_ENV=production - - DATABASE_URL=postgresql://postgres:xxx@db:5432/db - - RAILS_MASTER_KEY=xxx + - DATABASE_URL=postgresql://postgres:${PG_PASSWORD}@db:5432/db + - RAILS_MASTER_KEY=${RAILS_MASTER_KEY} - REDIS_URL=redis://redis:6379/0 depends_on: - db @@ -31,7 +31,7 @@ services: volumes: - ../taw_data/pg:/var/lib/postgresql/data environment: - - POSTGRES_PASSWORD=xxx + - POSTGRES_PASSWORD=${PG_PASSWORD} - POSTGRES_DB=db redis: