Docker Compose validation loop: Missing required environment variables in Talawa-API

anshika_prasad

New member
I am trying to set up a local development environment for the Talawa-Admin and Talawa-API. While running the API via Docker, I am encountering a "cascading" validation error during the interpolation phase of docker compose.
Every time I run "docker compose --env-file .env up -d" or "docker compose config", the process fails because of a missing required variable. As soon as I add one missing variable to my .env file, the next one in the docker-compose.yml file throws an error. So far, I have hit errors for:

  • API_ADMINISTRATOR_USER_NAME
  • API_COMMUNITY_X_URL
  • MINIO_BROWSER
  • API_HOST
  • API_COMMUNITY_REDDIT_URL
    and many more......
It appears the docker-compose.yml is configured with strict mandatory interpolation for several community and system variables that are not present in the provided sample .env file.

If anyone is facing the same issue and have resolved it, then please kindly help me with this one.


1767868780224.webp








My .env file:

COMPOSE_PROJECT_NAME=talawa-api
API_UID=1000
API_GID=1000
PWD=.
PORT=4000

# Databases
POSTGRES_USER=talawa
POSTGRES_PASSWORD=********
POSTGRES_DB=talawa_db
DATABASE_URL=postgresql://talawa:********@postgres:5432/talawa_db
MONGODB_URL=mongodb://mongodb:27017/talawa-api
REDIS_URL=redis://redis:6379

# API Setup
API_BASE_URL=http://localhost:4000
SECRET_KEY=********

# Admin Account
API_ADMINISTRATOR_USER_EMAIL_ADDRESS=administrator@email.com
API_ADMINISTRATOR_USER_NAME=Admin User
API_ADMINISTRATOR_USER_PASSWORD=********

# Community Socials & Info
API_COMMUNITY_NAME=Talawa Community
API_COMMUNITY_DESCRIPTION=A community for Talawa users
API_COMMUNITY_LOCATION=Global
API_COMMUNITY_FACEBOOK_URL=https://facebook.com
API_COMMUNITY_TWITTER_URL=https://twitter.com
API_COMMUNITY_INSTAGRAM_URL=https://instagram.com
API_COMMUNITY_LINKEDIN_URL=https://linkedin.com
API_COMMUNITY_YOUTUBE_URL=https://youtube.com
API_COMMUNITY_GITHUB_URL=https://github.com/palisadoes
API_COMMUNITY_WEBSITE_URL=https://talawa.io
API_COMMUNITY_SLACK_URL=https://slack.com
API_COMMUNITY_DISCORD_URL=https://discord.com
API_COMMUNITY_REDDIT_URL=https://reddit.com
API_COMMUNITY_TIKTOK_URL=https://tiktok.com
API_COMMUNITY_TELEGRAM_URL=https://telegram.org
API_COMMUNITY_X_URL=https://x.com
API_HOST=0.0.0.0

# Inactivity Timeout
API_COMMUNITY_INACTIVITY_TIMEOUT_DURATION=30
API_COMMUNITY_INACTIVITY_TIMEOUT_UNIT=days

# Organization Info
API_ORGANIZATION_NAME=Talawa Community
API_ORGANIZATION_COUNTRY=USA
API_ORGANIZATION_CITY=New York
API_ORGANIZATION_STATE=NY
API_ORGANIZATION_ZIP_CODE=10001
API_ORGANIZATION_ADDRESS=123 Talawa Street
API_ORGANIZATION_CONTACT_NUMBER=1234567890
API_ORGANIZATION_EMAIL_ADDRESS=admin@talawa.io
API_ORGANIZATION_WEBSITE_URL=https://talawa.io

# Minio (Storage)
MINIO_BROWSER=on
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=********
MINIO_STORAGE_PATH=/data
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=********
MINIO_ENDPOINT=minio
MINIO_PORT=9000

# Mail Server
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USER=********
MAIL_PASS=********
 
The configuration documentation covers the minimum requirements.


It seems as if the documentation wasn't clear enough. Please open an issue so we can get it tracked.
 
The configuration documentation covers the minimum requirements.


It seems as if the documentation wasn't clear enough. Please open an issue so we can get it tracked.

Hi everyone,

I’ve managed to resolve the issue and wanted to share the details.

The root cause was strict environment variable interpolation in docker-compose.yml (using the ${VARIABLE:?error} syntax). The provided sample .env file was missing several mandatory keys (e.g., API_ADMINISTRATOR_USER_NAME, API_HOST, and various community URLs), which prevented Docker from parsing the configuration. I solved it by manually compiling a complete .env file that satisfies all these strict requirements.
As per the administrator's suggestion, I will go ahead and open a new issue regarding this documentation gap. I can also share my updated .env template or submit a PR to update the sample file so future contributors don't face the same blocker.

Thanks
 
Back
Top