envs
This commit is contained in:
15
.serena/memories/docker_compose_cleanup.md
Normal file
15
.serena/memories/docker_compose_cleanup.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Docker Compose Cleanup
|
||||
|
||||
Removed duplicate environment variables from quixotic-app service in docker-compose.yml:
|
||||
- TELEGRAM_BOT_TOKEN
|
||||
- DOMAIN
|
||||
- ACME_EMAIL
|
||||
- POSTGRES_DB
|
||||
- POSTGRES_USER
|
||||
- POSTGRES_PASSWORD
|
||||
|
||||
These variables are already loaded via `env_file: .env.docker` so duplicating them in the environment section was unnecessary. Kept only the essential variables that need to be explicitly set:
|
||||
- NODE_ENV: production
|
||||
- PORT: 3000
|
||||
- DATABASE_URL: constructed from postgres variables
|
||||
- DATABASE_SSL: false
|
||||
35
.serena/memories/docker_env_vars_production_fix.md
Normal file
35
.serena/memories/docker_env_vars_production_fix.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Docker Environment Variables Production Fix
|
||||
|
||||
## Problem Identified
|
||||
Environment variables weren't loading properly in production for the `quixotic-app` service, despite `.env.docker` file containing correct values.
|
||||
|
||||
## Root Cause
|
||||
The issue was in the Docker Compose environment variable syntax. Using array format (`- KEY=value`) instead of hash format (`KEY: value`) was causing variable precedence issues.
|
||||
|
||||
## Solution Applied
|
||||
Changed the `environment` section in `docker-compose.yml` from:
|
||||
```yaml
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- PORT=3000
|
||||
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
|
||||
# ... etc
|
||||
```
|
||||
|
||||
To:
|
||||
```yaml
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 3000
|
||||
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
|
||||
# ... etc
|
||||
```
|
||||
|
||||
## Environment Files Structure
|
||||
- `.env.docker` - Production environment variables (referenced by env_file)
|
||||
- `.env.docker.example` - Template with example values
|
||||
- Both traefik and postgres services were loading env vars correctly
|
||||
- Only quixotic-app service had the syntax issue
|
||||
|
||||
## Verification Command
|
||||
Use `docker-compose config` to verify environment variables are properly loaded before deployment.
|
||||
Reference in New Issue
Block a user