title: Docker-compose can't find .env file
body: <p>I have 3 containers with postgresql, nginx and django. The last two have their own Dockerfile, I run whole system with docker-compose. I have multiple problems:</p>
  
  <ol>
  <li><p>I can't run my custom nginx container, named <code>nginx</code> with <code>build: ./nginx/</code>. only <code>image: nginx</code>. Yes, I try <code>docker-compose build</code> as was suggested in <a href="https://stackoverflow.com/questions/33724125/custom-nginx-container-exits-immediately-when-part-of-docker-compose">thread</a>.</p></li>
  <li><p>Strange behavior with volumes, I mentioned theese one: <code>- ./web:/code</code> and nothing work, i commented it, but now Django said me:</p></li>
  </ol>
  
  <pre>
  
        /usr/local/lib/python3.5/site-packages/environ/environ.py:609: UserWarning: /code/translation_microservice/.env doesn't exist - if you're not configuring your environment separately, create one.
        "environment separately, create one." % env_file)
      Traceback (most recent call last):
        File "manage.py", line 22, in 
          execute_from_command_line(sys.argv)
        File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
          utility.execute()
        File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 337, in execute
          django.setup()
        File "/usr/local/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
          apps.populate(settings.INSTALLED_APPS)
        File "/usr/local/lib/python3.5/site-packages/django/apps/registry.py", line 108, in populate
          app_config.import_models()
        File "/usr/local/lib/python3.5/site-packages/django/apps/config.py", line 202, in import_models
          self.models_module = import_module(models_module_name)
        File "/usr/local/lib/python3.5/importlib/__init__.py", line 126, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
        File "", line 986, in _gcd_import
        File "", line 969, in _find_and_load
        File "", line 958, in _find_and_load_unlocked
        File "", line 673, in _load_unlocked
        File "", line 673, in exec_module
        File "", line 222, in _call_with_frames_removed
        File "/code/api_controller/models.py", line 8, in 
          from web.translation import TranslatedLesson, TranslatedStep
      ImportError: No module named 'web'
  
  </pre>
  
  <p>My tree of files:</p>
  
  <pre>
  .
  ├── docker-compose.yml
  ├── nginx
  │   ├── Dockerfile
  │   └── nginx.conf
  ├── __pycache__
  ├── README.md
  ├── venv
  │   ├── bin
  │   ├── include
  │   ├── lib
  │   └── pip-selfcheck.json
  └── web
      ├── .env
      ├── Dockerfile
      ├── manage.py
      ├── requirements.txt
      └── translation
  </pre>
  
  <p>My docker-compose file:</p>
  
  <pre>
  version: '3'
  
  services:
    site:
      build: ./web
      env_file: ./web/.env
      # wanna do this
      #volumes:
      #  - ./web:/code
      command: python manage.py runserver 0.0.0.0:8000
  
    proxy:
      # wanna  build: ./nginx/
      image: nginx
      ports:
        - "80:80"
        - "443:443"
      volumes:
        - /www/static
  
    postgres:
      restart: always
      image: postgres:latest
      ports:
        - "5432:5432"
      volumes:
        - /var/lib/postgresql/data/
  </pre>
  
  <p>And finally my both Dockerfiles. Django Dockerfile:</p>
  
  <pre>
  FROM python:3.5
  ENV PYTHONUNBUFFERED 1
  
  RUN mkdir /code
  WORKDIR /code
  ADD ./requirements.txt /code/
  RUN pip install --no-cache-dir -r requirements.txt
  ADD . /code/
  
  EXPOSE 8000
  
  CMD ["/usr/local/bin/gunicorn", "translation_microservice.wsgi", "-w", "2", "-b", ":8000", "--access-logfile", "-", "--capture-output"]
  </pre>
  
  <p>Nginx Dockerfile:</p>
  
  <pre>
  FROM nginx:latest
  
  COPY ./nginx.conf /etc/nginx/nginx.conf
  </pre>