2

I have a django-cookiecutter project that has multiple containers:

  • django
  • postgres
  • caddy
  • etc

When I deploy, I'm getting an error that the Postgres db cannot authenticate the POSTGRES_USER and POSTGRES_PASSWORD.

I'm passing the envs in my production.yml file as:

services:
  django: &django
    build:
      context: .
      dockerfile: ./compose/production/django/Dockerfile
    image: authible_production_django
    depends_on:
      - postgres
      - redis
    env_file:
      - ./.envs/.production/.django
      - ./.envs/.production/.postgres
    command: /gunicorn.sh

Question:

Since the service is not able to authenticate, how can I check the envs within one of these containers?

I want to make sure the envs are being recognized.

Thank you for your help-

Emile
  • 3,464
  • 8
  • 46
  • 77

1 Answers1

3

You can simply execute env inside the container using docker-compose:

docker-compose exec django env
Alexander Zeitler
  • 11,919
  • 11
  • 81
  • 124