services:
  app:
    build:
      context: ..
      dockerfile: docker_file/Dockerfile
    container_name: {{ project_slug }}_app
    ports:
      - "8000:8000"
    environment:
      - DB_HOST={{ db_host }}
      - DB_PORT={{ db_port }}
      - DB_USER={{ db_user }}
      - DB_PASSWORD={{ db_password }}
      - DB_NAME={{ db_name }}
      - REDIS_HOST=redis
      - REDIS_PORT=6379
    depends_on:
      - redis
    networks:
      - default

  redis:
    image: redis:alpine
    container_name: {{ project_slug }}_redis
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data
    networks:
      - default

volumes:
  redis_data:

networks:
  default:
    driver: bridge
