Skip to content
Snippets Groups Projects
Commit acf3379f authored by Aaron Dötsch's avatar Aaron Dötsch
Browse files

Clean up env variable management

parent f5399060
Branches
No related tags found
No related merge requests found
DATABASE_URL="postgresql://postgres:postgres@postgres:5432/postgres" DB_USERNAME="postgres"
BODY_SIZE_LIMIT=10485760 # 10MiB - increase default body size limit in order to upload large files (product images) DB_PASSWORD="postgres"
DB_NAME="postgres"
BODY_SIZE_LIMIT=10485760 # 10MiB
...@@ -4,15 +4,15 @@ services: ...@@ -4,15 +4,15 @@ services:
image: postgres:11.1 image: postgres:11.1
restart: always restart: always
environment: environment:
POSTGRES_PASSWORD: postgres POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: postgres POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: postgres POSTGRES_DB: ${DB_NAME}
ports: ports:
- "5432:5432" - "5432:5432"
volumes: volumes:
- ./postgres-data:/var/lib/postgresql/data - ./postgres-data:/var/lib/postgresql/data
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"] test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d ${DB_NAME}"]
interval: 5s interval: 5s
timeout: 30s timeout: 30s
retries: 5 retries: 5
...@@ -26,8 +26,9 @@ services: ...@@ -26,8 +26,9 @@ services:
depends_on: depends_on:
postgres: postgres:
condition: service_healthy condition: service_healthy
env_file: environment:
- .env BODY_SIZE_LIMIT: ${BODY_SIZE_LIMIT}
DATABASE_URL: postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_NAME}
volumes: volumes:
- ./article-images:/app/article-images - ./article-images:/app/article-images
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment