How to set up separate .env for development and production using Docker

Coming from an environment where I was manually doing a ssh into the remote server, doing a git pull and creating my .env(since it is gitignored), how do I separate development .env and a production .env. I used docker-machine to create an AWS EC2 instance. I created a production.yml and did docker-compose -f production.yml up -d. The container in the EC2 machine picked up my development .env which is not what I want.

Dockerfile

FROM python:3.6-alpine
ENV PYTHONUNBUFFERED 1

RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev git jpeg-dev zlib-dev libmagic
RUN python -m pip install --upgrade pip

RUN mkdir /writer-api
COPY requirements.txt /writer-api/
RUN pip install --no-cache-dir -r /writer-api/requirements.txt
COPY . /writer-api/
WORKDIR /writer-api

production.yml

version: "3"
services:
  postgres:
    restart: always
    image: postgres
    ports:
      - "5432:5432"
    volumes:
      - pgdata:/var/lib/postgresql/data/
  web:
    restart: always
    build: .
    command: gunicorn writer.wsgi:application -w 2 -b :8000
    environment:
      DEBUG: ${DEBUG}
      SECRET_KEY: ${SECRET_KEY}
      DB_HOST: ${DB_HOST}
      DB_NAME: ${DB_NAME}
      DB_USER: ${DB_USER}
      DB_PORT: ${DB_PORT}
      DB_PASSWORD: ${DB_PASSWORD}
      SENDGRID_API_KEY: ${SENDGRID_API_KEY}
      AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
      AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
      AWS_STORAGE_BUCKET_NAME: ${AWS_STORAGE_BUCKET_NAME}
    depends_on:
      - postgres
      - redis
    expose:
      - "8000"
  redis:
    restart: always
    image: "redis:alpine"
  celery:
    restart: always
    build: .
    command: celery -A writer worker -l info
    volumes:
      - .:/writer-api
    depends_on:
      - postgres
      - redis
  celery-beat:
    restart: always
    build: .
    command: celery -A writer beat -l info
    volumes:
      - .:/writer-api
    depends_on:
      - postgres
      - redis
  nginx:
    restart: always
    build: ./nginx/
    ports:
      - "80:80"
    depends_on:
      - web
volumes:
  pgdata:

Source: StackOverflow