diff --git a/.env.example b/.env.example index e376bea2286884b09c77191500ade13903dc844e..45274f36057e014a4ab5448a568feffb2e5eae15 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,4 @@ -DATABASE_URL="postgresql://postgres:postgres@postgres:5432/postgres" -BODY_SIZE_LIMIT=10485760 # 10MiB - increase default body size limit in order to upload large files (product images) +DB_USERNAME="postgres" +DB_PASSWORD="postgres" +DB_NAME="postgres" +BODY_SIZE_LIMIT=10485760 # 10MiB diff --git a/docker-compose.yml.example b/docker-compose.yml.example index 4a3b295e558d2b6d7f71da08915c5385687309ee..dc70a894a2cb9bc15234d46e134e80517a5e1dc4 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -4,15 +4,15 @@ services: image: postgres:11.1 restart: always environment: - POSTGRES_PASSWORD: postgres - POSTGRES_USER: postgres - POSTGRES_DB: postgres + POSTGRES_PASSWORD: ${DB_PASSWORD} + POSTGRES_USER: ${DB_USERNAME} + POSTGRES_DB: ${DB_NAME} ports: - "5432:5432" volumes: - ./postgres-data:/var/lib/postgresql/data healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"] + test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d ${DB_NAME}"] interval: 5s timeout: 30s retries: 5 @@ -26,8 +26,9 @@ services: depends_on: postgres: condition: service_healthy - env_file: - - .env + environment: + BODY_SIZE_LIMIT: ${BODY_SIZE_LIMIT} + DATABASE_URL: postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_NAME} volumes: - ./article-images:/app/article-images